Select Records using Criteria that Contain Text

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!
 
D

Daren

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?
 
K

KARL DEWEY

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*";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top