Ms Access Query

Posted on 2009-04-30
Last Modified: 2013-11-29
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
Question by:lankapala
    LVL 25

    Accepted Solution

    Hi lankapala,


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

    LVL 10

    Expert Comment

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
    If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now