field lengths ?

P

Pat Backowski

Hi Everyone,

Table A
data= 20text
Table B
Key=4text
Data= doesn't matter

Due to modifications beyond my control, I need to select data from table B,
which has a key field length of 4(text) using the first 4 characters of a
field in table A which has a field length 20(text). When I use something
like "Select tableB.data where tableB.key = tableA.data, it doesn't
work(tableA.data = "1234")

Any and all help appreciated.
Pat
 
B

Brendan Reynolds

SELECT tableB.data FROM tableB INNER JOIN tableA ON Left$(tableB.data, 4) =
tableA.data

You can't create a non-equi-join like this in the graphical query designer's
Design View, but you can create a query using an equi-join (tableB.data =
tableA.data) then switch to SQL View to edit it.
 
P

Pat Backowski

Thanks, Brendan....that's what I neded.

Brendan Reynolds said:
SELECT tableB.data FROM tableB INNER JOIN tableA ON Left$(tableB.data, 4) =
tableA.data

You can't create a non-equi-join like this in the graphical query designer's
Design View, but you can create a query using an equi-join (tableB.data =
tableA.data) then switch to SQL View to edit it.
 
Top