Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove time from time date in query

Status
Not open for further replies.
Oct 9, 2004
7
0
0
US
I have a query that displays date and time. Example, "10/8/2004 6:27:02 PM". I would like to evaluate it by the current date.

So I do the following
FieldName: TheDate
Criteria: Date()

It doesn't seem to work. So I would like a way to remove the time from the date/time field. So it would display 10/8/2004 instead of "10/8/2004 6:27:02 PM". Can you come up an expression that would accomplish this. The name of the field is TheDate.


 
hi.
Code:
field: format(TheDate, "yyyymmdd")
criteria: format(Date(), "yyyymmdd")



Skip,
[sub]
[glasses] [b][red]Be advised:[/red][/b]  It's been reported that a wee psychic is roaming the countryside.
[b]Small Medium @ Large![/b] [tongue][/sub]
 
I would use:
Field: DateValue([theDate])
Criteria: Date()

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top