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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query critieria to exclude 2 words



 
 
Thread Tools Display Modes
  #1  
Old November 30th, 2009, 11:04 PM posted to microsoft.public.access.queries
Pasadena-D via AccessMonster.com
external usenet poster
 
Posts: 9
Default Query critieria to exclude 2 words

Hello,

I have a query that I want to run to pull data, but I want it to exclude
"Complete" and "Approved" in the Status field, and return everything else
except those 2 words. I have tried several different ways to do it, but I can
only get it to exclude one or the other. I'm using this right now:

Not Like "Complete" AND "Approved"

This only gives me Approved, which I don't want. Please help!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200911/1

  #2  
Old November 30th, 2009, 11:12 PM posted to microsoft.public.access.queries
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default Query critieria to exclude 2 words

I believe you want those records that don't have "Complete" and those that
don't have "Approved"

First, if the ONLY value stored in that status field is a single word (e.g.,
"Complete", "Approved", ... ?"Pending", ...), you do not need to use the
"Like" condition. You could use something similar to (untested):

Not "Complete" and Not "Approved"

You are leaving out the "not" for the second condition.

Regards

Jeff Boyce
Microsoft Access MVP

--
Disclaimer: This author may have received products and services mentioned
in this post. Mention and/or description of a product or service herein
does not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.

"Pasadena-D via AccessMonster.com" u56499@uwe wrote in message
news:9fe8bb0a7d6bc@uwe...
Hello,

I have a query that I want to run to pull data, but I want it to exclude
"Complete" and "Approved" in the Status field, and return everything else
except those 2 words. I have tried several different ways to do it, but I
can
only get it to exclude one or the other. I'm using this right now:

Not Like "Complete" AND "Approved"

This only gives me Approved, which I don't want. Please help!

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...eries/200911/1



  #3  
Old November 30th, 2009, 11:44 PM posted to microsoft.public.access.queries
Pasadena-D via AccessMonster.com
external usenet poster
 
Posts: 9
Default Query critieria to exclude 2 words

Jeff,

It works great! Thanks for your help.

Jeff Boyce wrote:
I believe you want those records that don't have "Complete" and those that
don't have "Approved"

First, if the ONLY value stored in that status field is a single word (e.g.,
"Complete", "Approved", ... ?"Pending", ...), you do not need to use the
"Like" condition. You could use something similar to (untested):

Not "Complete" and Not "Approved"

You are leaving out the "not" for the second condition.

Regards

Jeff Boyce
Microsoft Access MVP

Hello,

[quoted text clipped - 7 lines]

This only gives me Approved, which I don't want. Please help!


--
Message posted via http://www.accessmonster.com

 




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 07:21 PM.


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