Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Access 2003- Help with Query to search a number of fields in db!!

  • 14-07-2011 3:57pm
    #1
    Registered Users, Registered Users 2 Posts: 45


    Hey,
    Would anyone be able to advise the best way to do the following.
    I have a table called clients- that contains the usual information ie client name, address fields, county, tel no etc. Am looking to create a query that searches all the address fields and locates the address word i type into the pop up box. any advise much appreciated


Comments

  • Registered Users, Registered Users 2 Posts: 1,456 ✭✭✭FSL


    SELECT whatever you want FROM your database table WHERE your search criteria matches.

    If you are searching for a word or phrase use LIKE.
    i.e. where field name LIKE '%your word/phrase%'

    The % at the beginning signifies the field can have anything before the selection criteria and the % at the end means the field can have any thing after the selection criteria.

    Either % can be omitted to determine how much other than the search criteria may be contained in the field.


  • Registered Users, Registered Users 2 Posts: 75 ✭✭1qTour


    SQL might look something like...

    SELECT COUNT(*) as NumRecords WHERE Address1 LIKE '%SearchWord%' OR Address2 LIKE '%SearchWord%' OR Address3 LIKE '%SearchWord%';

    The '%' wildcard might be '*' while using directly from access. This will return the number of records that match the search criteria not the actual records.


  • Registered Users, Registered Users 2 Posts: 45 E26


    Thanks a mill for the replies- got it sorted:)


Advertisement