Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002
    Location
    Houston, Texas
    Posts
    85

    Unanswered: Help with LIKE comparison...

    Howdy. I'm running Access 2003 on Windows XP. I need to write a simple query to compare to tables, and I must admit it's driving me nuts! This is part of a shopping cart system that collects registration data for an upcoming conference. There are two tables involved:

    Postback2 collects data that is associated with credit card transactions
    Ordered_By_Name
    Order_Number
    Order_Date

    Registration_TempData collects the data from the registration form
    RegisID
    RegisOrderNumber
    RegisLastName
    RegisFirstName
    RegisDateReceived

    Ordered_By_Name contains BOTH the first and last name (as well as an initial -- this is the name as it appears on the credit card). These names are separate (and sometimes different: it might be Rob on the form and Robert on the card). I desperately need a query that will return a result that shows me which Postback2 row matches the associated row from Registration_TempData. I've been playing with all sorts of wild cards, but unfortunately all the online tutorials are for when you know the string you're looking for, and not when you're trying to pull it out of a database.

    Any and all help will be greatly appreciated.

    Here's my starting point:

    SELECT *
    FROM Postback2, Registration_TempData
    WHERE Ordered_By_Name LIKE RegisLastName

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    WHERE Ordered_By_Name LIKE '*' + RegisLastName + '*'
    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
  •