Query Criteria is not working

  • Thread starter Thread starter Chad Cameron
  • Start date Start date
C

Chad Cameron

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
 
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
 
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)
 
Chad Cameron said:
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
 
Back
Top