Ms Access Query

i wrote a sql code its not working, Please find the below my code.
SELECT DISTINCT ([Table2].IdLocation) AS Expr1, Table2.Address
FROM Table1A, Table2
WHERE  Table2.Address  Like ' "& [Table1A].[Address]+"* '

Its not showing any Error,But No out put
LVL 2
lankapalaAsked:
Who is Participating?
 
lwadwellCommented:
Hi lankapala,

Try:

SELECT DISTINCT ([Table2].IdLocation) AS Expr1, Table2.Address
FROM Table1A, Table2
WHERE  Table2.Address  Like [Table1A].[Address] & "*"

lwadwell
0
 
MaduKpCommented:
Hi lankapala,

It's not clear what exactly you wanted to do. If you can be more descriptive, may be post address data in two tables and describe your requirement here...

How ever the query you typed here is wrong. since  ' "& [Table1A].[Address]+"* ' make a whole string part.

It can be changed to be correct as this way,

SELECT DISTINCT ([Table2].IdLocation) AS Expr1, Table2.Address
FROM Table1A, Table2
WHERE  Table2.Address  Like [Table1A].[Address]+'*'

but i guess this is not what you want to do,

Let's supose you have data

Table1A- 1111A, 1111B, xx ,y ,  ddd, eeeee,
Table2 - 1111, xxxx, derere, 3333, ee,

you need to select IdLocation of table 2 for following address values: 1111, ee

Please give your feedback, and correct me if i am missing something here....
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.