If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Select Records using Criteria that Contain Text
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! |
#2
|
|||
|
|||
Select Records using Criteria that Contain Text
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? "Daren" wrote: 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! |
#3
|
|||
|
|||
Select Records using Criteria that Contain Text
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*"; -- KARL DEWEY Build a little - Test a little "Daren" wrote: 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? "Daren" wrote: 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! |
Thread Tools | |
Display Modes | |
|
|