I would like to execute the SQL statement below in vba code written for MS Access, and I want the integer values of the ID fields to be compared in the JOIN ON criteria. However, I get an error when using CInt(). I've also tried Val(), CAST(), and Convert().
Set RecordSet = "SELECT A.id, B.id FROM A LEFT OUTER JOIN B ON CInt(A.id)=CInt(B.id)"
the entire id contains only numbers. For example A.id=0123, and B.id=00123 . I want to compare the value integer of the two so that A.id=B.id is true.
Thanks!
Lillyanna
Set RecordSet = "SELECT A.id, B.id FROM A LEFT OUTER JOIN B ON CInt(A.id)=CInt(B.id)"
the entire id contains only numbers. For example A.id=0123, and B.id=00123 . I want to compare the value integer of the two so that A.id=B.id is true.
Thanks!
Lillyanna