Execute CStr () Expression Inside JOIN Statement

I have two fields in separate linked tables with the same data, but with different data types. I cannot change data types in tables. I am trying to execute a query that joins two tables together based on this data, but since the types are different, I need to convert the number to a string. I basically tried:

...
FROM Table1 LEFT JOIN Table2 ON CStr([Table1].[Column]) = Table2.Column
...

I just keep getting error messages, basically "Combine expression is not supported."

Can someone shed some light on what I can do wrong / what I could do better?

Thank.

+5
source share
1 answer

Here is your text FROMreformatted:

FROM
    Table1.Column
    LEFT JOIN Table2.Column
    ON CStr([Table1].[Column]) = Table2.Column

, Table1.Column Table2.Column. (), ( ).

:

FROM
    Table1
    LEFT JOIN Table2
    ON CStr([Table1].[Column]) = Table2.Column

Access JOIN, ON. , , , Immediate .

Set rs = CurrentDb.OpenRecordset( _
"SELECT Count(*) AS row_count" & vbCrLf & _
"FROM Table1 AS t1" & vbCrLf & _
"LEFT JOIN Table2 AS t2" & vbCrLf & _
"ON CStr(t1.[Column])=t2.[Column];") : _
? rs(0) : _
rs.Close : _
Set rs = Nothing

, (, "_" ) .

+1

All Articles