Select Records using Criteria that Contain Text

  • Thread starter Thread starter Daren
  • Start date Start date
D

Daren

Hello,

I have two fields, one is Name and the other is Site. The Name field can
contain pharmacy, pharmacies, drug, or drugs in any length of text string,
such as Jack's Pharmacy Shop. The Site field contains that same information.
I want to create criteria that will show all records that meet the criteria
of pharmacy, pharmacies, drug, and drugs in those two fields. Can you tell
me how I can write the criteria to show and count records with pharmacy,
pharmacies, drug, or drugs in them in both the Name and Site fields? Thanks!
 
Also, I only want to count a record once if it has any of the criteria below
in the Name AND Site fields to prevent double counting. How can I do this
also?
 
SELECT Count([Name]) AS Drug_Store
FROM YourTable
WHERE [Name] Like "*pharmacy*" OR [Name] Like "*pharmacies*" OR [Name] Like
"*drug*" OR [Site] Like "*pharmacy*" OR [Site] Like "*pharmacies*" OR [Site]
Like "*drug*";
 
Back
Top