Reply
SQL quick question... searching for a variable within a string
Old 06-15-2009, 05:43 PM SQL quick question... searching for a variable within a string
sepple's Avatar
Super Talker

Posts: 141
Trades: 0
I am trying to use Microsoft Access to match company names.

I want "Pepsi" to find all of the following:
The Pepsi Company
Pepsi, Inc.
Pepsi

Code:
WHERE  COMPANY_NAME = "%" & [Company Short Name]& "%"
Please help, I am struggling and can't find any help online.

Thanks in advance,

Stephen
sepple is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-16-2009, 02:47 AM Re: SQL quick question... searching for a variable within a string
Super Talker

Posts: 120
Name: David Jackson
Trades: 0
use a LIKE instead of an EQUALS

Code:
 WHERE  COMPANY_NAME LIKE "%company name%"
davidj is offline
Reply With Quote
View Public Profile
 
Old 06-16-2009, 11:04 AM Re: SQL quick question... searching for a variable within a string
sepple's Avatar
Super Talker

Posts: 141
Trades: 0
Turns out...

WHERE COMPANY_NAME = "*" & [Company Short Name]& "*"

Works great....thanks
__________________
Thanks
Stephen

Last edited by sepple; 06-16-2009 at 11:24 AM..
sepple is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SQL quick question... searching for a variable within a string
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11526 seconds with 13 queries