Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    Nottingham - UK
    Posts
    113

    Wink Unanswered: Search whole field query multiple tables / fields

    Hello folks - im using MS Access 2003

    I am trying to create a search function that will query multiple tables / fields, I have got a simple search running that searches anywhere in a single field using LIKE etc (as below).

    SELECT *
    FROM Tbl_Pymt_Breakdown
    WHERE (((Tbl_Pymt_Breakdown.Pymt_Name) Like "*" & [name] & "*"));

    Does anyone have any examples I could review please ?

    Thanks in advance

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    to query multiple fields:
    Code:
    select *
      from Tbl_Pymt_Breakdown
     where Pymt_Name like "*" & [name] & "*"
        or second_field like "*" & [name] & "*"
        or third_field like "*" & [name] & "*"
        or ...
    to query multiple tables, it depends on whether they are related
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •