Results 1 to 6 of 6

Thread: help with a query

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    help with a query

    I have two tables, each with three fields. Each table has a vendor field, but there not going to be identical. I need to search through the vendors if I can find a partial match. I've tried...

    SELECT table1.vendor, table2.vendor
    FROM table1, table2
    WHERE table1.vendor = '%table2.vendor%'

    I put in a dummy field that I knew would match just to make sure, but it still didn't return anything...any advice?

    thanks,
    eye

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    use LIKE instead of the =
    "It's cold gin time again ..."

    Check out my website here.

  3. #3
    Hyperactive Member
    Join Date
    Apr 2002
    Location
    Georgia
    Posts
    337
    SELECT table1.vendor, table2.vendor
    FROM table1, table2
    WHERE table1.vendor = '%table2.vendor%'

    Try using Like instead of =

    WHERE table1.vendor Like '%table2.vendor%'

  4. #4

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    I've tried that too. Doesn't return anything and I have a dummy record in there that should get returned


    eye

  5. #5
    Addicted Member
    Join Date
    Jul 2002
    Location
    Brussels, Belgium
    Posts
    139
    try this then

    SELECT table1.vendor, table2.vendor
    FROM table1, table2
    WHERE table1.vendor like '%'+table2.vendor+'%'

  6. #6

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075
    hey doe, tried that query...it just keeps running....

Posting Permissions

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



Click Here to Expand Forum to Full Width