Date conversion

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I'm thinking this is easier than it has been so far, but here goes. Access
2003 SP2. Have a text field that returns a date in the format of mm/dd/yy.
I want to create two queries, both filtering on this field. First, I want
to filter on the value of that field equaling "today's date", obviously
based on the current day. Second, I want to filter on value of the filter
equaling "yesterday" for the second query.

When I attempt to use the now() function or day() or month(), I'm getting a
date in the format of 8/25/06 whereas the date of my text field is like
08/25/06. Is there some way to append the format to these date functions?
I did not see anything in Help indicating that there was.

Thanks for any light that can be shed,

Dave
 
A date is a date is a date. Make sure that when you pull the date out
of your text field, you are surrounding it with #'s (i.e. #8/25/06#)
That way, the query will know it is a date.

SQL always looks at dates as month/day/year, and will know that
#8/25/06# is equal to #08/25/2006#

Hope this helps,
JK
 
Back
Top