A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Select Records using Criteria that Contain Text



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2009, 04:02 PM posted to microsoft.public.access.tablesdbdesign
Daren
external usenet poster
 
Posts: 153
Default 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  
Old February 24th, 2009, 04:11 PM posted to microsoft.public.access.tablesdbdesign
Daren
external usenet poster
 
Posts: 153
Default 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  
Old February 25th, 2009, 02:41 AM posted to microsoft.public.access.tablesdbdesign
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:41 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.