setting "date" criteria

  • Thread starter Thread starter Jeff G
  • Start date Start date
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
 
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.
 
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


.
 
Back
Top