string comparsion using access--help

  • Thread starter Thread starter Cheryl
  • Start date Start date
C

Cheryl

Hi
I using access 2003. I am trying to compare data from two tables. Table A
and Table B. Table A has 12 digits in 1 column and table b has 10 digits in
1 column. I need to compare Table A data starting in position 2 and ending
in positon 11. I tried using instr function but it did not work.

SELECT A.ItemLookupCode, B.ItemLookupCode
FROM A, B
WHERE InStr(2, A.ItemLookupCode, B.ItemLookupCode,11, COMPARE)



Thanks

Cbs
 
Hi
I using access 2003. I am trying to compare data from two tables. Table A
and Table B. Table A has 12 digits in 1 column and table b has 10 digits in
1 column. I need to compare Table A data starting in position 2 and ending
in positon 11. I tried using instr function but it did not work.

SELECT A.ItemLookupCode, B.ItemLookupCode
FROM A, B
WHERE InStr(2, A.ItemLookupCode, B.ItemLookupCode,11, COMPARE)

Thanks

Cbs

use the "mid()" function
 
Your syntax for InStr is incorrect (and it's not the correct function
anyhow).

SELECT A.ItemLookupCode, B.ItemLookupCode
FROM A INNER JOIN B
WHERE Mid(A.ItemLookupCode, 2, 10) = B.ItemLookupCode
 

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

Back
Top