SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Other Forums
 MS Access
 CONTAINS command, or equivalent ??
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

expatCanuck
Starting Member

USA
2 Posts

Posted - 05/12/2009 :  12:53:07  Show Profile  Visit expatCanuck's Homepage  Reply with Quote
Greetings -

I'd like to know if an SQL command exists that will let one find all records that contain a specified string in a specified field/column.

For example, assume that we have a list of publications. I'd like to know if it's possible in an MS-Access query to find all publications that have the string 'World' in their name (e.g. - Worldwide Zookeepers, World Zoos, Zoos of the World). Ideally case-insensitively.

I've been trying the LIKE command, but either I'm using it incorrectly, or it doesn't provide this functionality.

Thanks kindly.

- Richard
http://oldWithoutMoney.com

expatCanuck
Starting Member

USA
2 Posts

Posted - 05/12/2009 :  13:11:26  Show Profile  Visit expatCanuck's Homepage  Reply with Quote
Hmmm. RTFM. Seems one needs to use wildcards to make LIKE work.
Go to Top of Page

tosscrosby
Aged Yak Warrior

USA
676 Posts

Posted - 05/12/2009 :  16:54:25  Show Profile  Reply with Quote
where fieldname like '%world%' or where upper(fieldname) like '%WORLD%' if you're running a case sensitive collation).

Terry

-- Procrastinate now!
Go to Top of Page

Sequin
Starting Member

United Kingdom
25 Posts

Posted - 05/22/2009 :  06:54:00  Show Profile  Reply with Quote
In MS Access, the wildcard characters are * and ?, not % and _ (or certainly were up to Access 2003)

Select * from Table where Field1 like "*world*"

Access is by default case insensitive
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000