limit date outputs in query

Kelly@AllenEnt

Registered User.
Local time
Today, 11:43
Joined
Oct 4, 2012
Messages
51
I have a query that is pulling information from 2 tables: airport codes and orders. I was able to select the 7 states I wanted without any problem. I am trying to limit the "order date" by using the criteria ">=#1/1/2011#". I want the query to only choose those orders that were dated 1/1/2011 to the present.

No matter what I place in the criteria for the date, the data never changes. I even tried "=date()" just to see if it would change. I tried "Between #1/1/2011# And #12/31/2013#" and the results were the same. This should be a simple task (as were the states) but I don't know why it is not yielding the desired results.

Please help!
 
You're not including the quotes, are you? The criteria would be:

Between #1/1/2011# And #12/31/2013#

That presumes the field is date/time.
 
No I am not including the quotes. I just put them there so you would know exactly what I was typing.
 
And the field the criteria is on has the Date/Time data type? Can you post the db here?
 
I cannot post the database as it contains confidential information. screen captures are attached. I assure you it is date/time in the Order table. I have typed in the query criteria:

Between #1/1/2011# And #12/31/2013#

The results are showing 1996, 2002 and above.
 

Attachments

Your criteria on the state field is the problem. In design view, you need to add the date criteria on every line to match the states. Alternatively, just have one line and replace the multiple state lines with:

In("AL", "AR", ...)
 

Users who are viewing this thread

Back
Top Bottom