parsing date field

T

TKai

I have a record created date field. On the form its
default value is NOW(). The problem is when I try to run
a query to show only records created between specific
dates I do not get the records I expect. How do I parse
the field to return only the date?

Thanks so much.
 
J

John Vinson

I have a record created date field. On the form its
default value is NOW(). The problem is when I try to run
a query to show only records created between specific
dates I do not get the records I expect. How do I parse
the field to return only the date?

Thanks so much.

Three ways...

If you only want the date field in the record, use Date() as the
default instead of Now().

Or, in your Query, put your criterion on a calculated field

DateOnly: DateValue([datetimefield])

Or, use a criterion of
= CDate([Enter start date:]) AND < DateAdd("d", 1, DateValue([Enter end date:]))

to include times on the end date past midnight.
 

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

Top