Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Like "% etc %"

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
This should be a no brainer but is proving to be a DPM for me.

I'm creating an SQL query in Access 2000 using the 'Like' clause.

This statement returns data:

SELECT Distinct Org_Name
FROM KPI_Auto_Data
WHERE Org_Name Like "CN NURSING - WN";

This statement returns zero records

SELECT Distinct Org_Name
FROM KPI_Auto_Data
WHERE Org_Name Like "%CN NURSING - WN%";

The only difference is the inclusion of the wild card operator %.

Ultimately, I am after all records with Org_Name containg the string "NURSING"

Thanks

 
SELECT Distinct Org_Name
FROM KPI_Auto_Data
WHERE Org_Name Like '*NURSING*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top