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 » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query Criteria is not working



 
 
Thread Tools Display Modes
  #1  
Old March 9th, 2010, 11:41 PM posted to microsoft.public.access
Chad Cameron
external usenet poster
 
Posts: 84
Default Query Criteria is not working

I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get account
codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd



  #2  
Old March 9th, 2010, 11:51 PM posted to microsoft.public.access
Chad Cameron
external usenet poster
 
Posts: 84
Default Query Criteria is not working

my mistake.
I needed to use NOT = 4125 AND NOT = 4121

thanks
Chad

"Chad Cameron" remove NOT wrote in message
...
I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get
account codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd





  #3  
Old March 9th, 2010, 11:56 PM posted to microsoft.public.access
Kc-Mass
external usenet poster
 
Posts: 362
Default Query Criteria is not working

Hi Chad,

Why don't you post the SQL of your query and then someone can easily help
you.
Open your query in the query design panel and right click on the top bar
and choose sql view.
copy that text and post it in a message.

Regards

Kevin


"Chad Cameron" remove NOT wrote in message
...
I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get
account codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd





  #4  
Old March 10th, 2010, 12:25 AM posted to microsoft.public.access
KARL DEWEY
external usenet poster
 
Posts: 10,767
Default Query Criteria is not working

The account code criteria needs to be --
4125 AND 4121

--
Build a little, test a little.


"Chad Cameron" wrote:

I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get account
codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd



.

  #5  
Old March 10th, 2010, 12:58 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Query Criteria is not working

On Tue, 9 Mar 2010 15:41:50 -0800, "Chad Cameron"
remove NOT wrote:

I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get account
codes 4125 and 4121.


If you use OR, then you'll get all records because 4125 is in fact not equal
to 4121, and vice versa.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.


I have no idea what you mean.

Try a criterion on account code of

NOT IN(4121, 4125)

--

John W. Vinson [MVP]
  #6  
Old March 13th, 2010, 05:32 PM posted to microsoft.public.access
De Jager
external usenet poster
 
Posts: 393
Default Query Criteria is not working


"Chad Cameron" remove NOT wrote in message
...
I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get
account codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd




  #7  
Old March 17th, 2010, 01:47 PM posted to microsoft.public.access
joelgeraldine
external usenet poster
 
Posts: 201
Default Query Criteria is not working

kkbbb

"Chad Cameron" remove NOT a écrit dans le message
de groupe de discussion : ...
I am having an issue with the criteria of a query.

I am limiting the data by a date range, an account code, and the number of
loads.
The date uses BETWEEN @FromDate AND @ToDate
The account code uses NOT = 4125 OR NOT = 4121
The loads is 0

With the above scenerio, I get no loads which are 0, but I still get
account codes 4125 and 4121.

If I put the account criteria in seperate columns, then I remove those
account codes, but then I get loads that have 0.

Any ideas?
Cahd



 




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