Problems with Data Format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to filter a select query by a date. However, the data looks like
this "7/6/2002 3:54:11 PM", and my filter looks like this "=#7/6/2002#" and I
am not getting any results. I am assuming I need to reformat or change the
data, but I have tried everything I know. The Data Type in the table is
Short Date. Any Ideas?
 
You can use the DateValue function to get just the date and search against
that.

Field: DateOnly: DateValue([Your Date Time Field])
Criteria: = #7/6/2002#

Or you can use criteria like

Field: [Your Date Time Field]
Criteria: >= #7/6/2002# and < #7/7/2002#


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Janet said:
I am trying to filter a select query by a date. However, the data looks like
this "7/6/2002 3:54:11 PM", and my filter looks like this "=#7/6/2002#" and I
am not getting any results. I am assuming I need to reformat or change the
data, but I have tried everything I know. The Data Type in the table is
Short Date.

Short Date is a **format**, not a data type.

Change the date field to a calculated field aomething like:
MyDate: DateValue(datefield)

then your criteria should work.
 
That works...THANKS VERY MUCH

Marshall Barton said:
Short Date is a **format**, not a data type.

Change the date field to a calculated field aomething like:
MyDate: DateValue(datefield)

then your criteria should work.
 
Back
Top