Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 234
  • Last Modified:

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
0
lankapala
Asked:
lankapala
1 Solution
 
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now