filter date/time

  • Thread starter Thread starter John
  • Start date Start date
J

John

I have a field that has both date and time, is there a way to filter out the
time?
 
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.
 
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.
 
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]
 

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

Back
Top