field lengths ?

G

Guest

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top