G
Guest
In a query, how do I eliminate the time portion of a date/time column so I
can group on the date?
can group on the date?
In a query, how do I eliminate the time portion of a date/time column so I
can group on the date?
John W. Vinson said:In a query, how do I eliminate the time portion of a date/time column so I
can group on the date?
DateValue([datefield])
John W. Vinson [MVP]
I used it, but it converts 8/31/2007 to 8/1/2007 ?
I checked if I run:
datevalue(8/31/2007) I get 8/1/2007
datevalue("8/31/2007") gives 8/31/2007
APath said:Not sure if this will help, I'm definitely not any type of expert and
maybe
Mr. Vinson can make me aware of any repercussions in using the
following...but it works for me...
format([Datevalue],"m/d/yyyy")
for the field result starting with "8/31/2009 17:42:00" I end up with
"8/31/2009".
APath
John W. Vinson said:I have NO idea, and have never seen this happen. I could imagine
datevalue(8/31/2007) giving #12/30/1899# with some small time value, but
not
giving 8/1.
What's the context? Where did you put this expression? If it's in a
query,
please post the SQL; if it's on a form, please post the actual
expression, and
the datatype and field value of the control that you're referencing.
John W. Vinson [MVP]