setting "date" criteria

J

Jeff G

When I set a criteria in a query "between [a] and " to
prompt for dates "a" and "b" and then type in "8/16/04"
for "a" and "8/31/04" for "b" when prompted, I get
extraneous dates returned from dates prior to this range
from 2002 and 2003. I If I set the criteria as: "between
#8/16/04# and #8/30/04#" the dates are correctly displayed
(no extraneous data is displayed from 2002 and 2003). Any
ideas on how to get the correct dates displayed when
prompted by the query? The date field in the query is
the "general" date format.

thanks much
Jeff G
 
R

Rick Brandt

Jeff G said:
When I set a criteria in a query "between [a] and " to
prompt for dates "a" and "b" and then type in "8/16/04"
for "a" and "8/31/04" for "b" when prompted, I get
extraneous dates returned from dates prior to this range
from 2002 and 2003. I If I set the criteria as: "between
#8/16/04# and #8/30/04#" the dates are correctly displayed
(no extraneous data is displayed from 2002 and 2003). Any
ideas on how to get the correct dates displayed when
prompted by the query? The date field in the query is
the "general" date format.


Open the parameters dialog in the query's design view and explicitly set
the [a] and parameters to Date DataTypes. Then try it again. Access
might be making an improper assumption about the DataType and doing a Text
comparison.
 
J

Jeff G

Bingo! thanks for your help
-----Original Message-----
When I set a criteria in a query "between [a] and " to
prompt for dates "a" and "b" and then type in "8/16/04"
for "a" and "8/31/04" for "b" when prompted, I get
extraneous dates returned from dates prior to this range
from 2002 and 2003. I If I set the criteria as: "between
#8/16/04# and #8/30/04#" the dates are correctly displayed
(no extraneous data is displayed from 2002 and 2003). Any
ideas on how to get the correct dates displayed when
prompted by the query? The date field in the query is
the "general" date format.


Open the parameters dialog in the query's design view and explicitly set
the [a] and parameters to Date DataTypes. Then try it again. Access
might be making an improper assumption about the DataType and doing a Text
comparison.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top