filter date/time

D

Douglas J. Steele

What do you mean by filter out the time?

If what you want is to refer only to the date portion of the field, you can
use the DateValue function.

If what you want is to refer only to the time portion of the field, you can
use the TimeValue function.
 
J

John

correct I have a field that has this 1/9/2008 11:33:52 AM I need to remove
the time from the query field.
 
J

John W. Vinson

correct I have a field that has this 1/9/2008 11:33:52 AM I need to remove
the time from the query field.

To search for the date (without the time having any effect) you can either put
a calculated field in the query

JustTheDate: DateValue([fieldname])

More efficiently, since it will use an Index on the field if there is one, use
a criterion
= [Enter date:] AND < DateAdd("d", 1, [Enter date:])


To permanently and irrevokably remove the time portion of the field from all
records in the table, run an Update query updating the field to

=DateValue([fieldname])

This will replace all the times with midnight, 00:00:00.

John W. Vinson [MVP]
 
Top