M
mscertified
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]
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
[quoted text clipped - 10 lines]John W. Vinson [MVP]
I have a report with October dates like 10/01/2009 12:22:39 format and
so on.
I formated the date field in one of my queries as
Format(DateValue([post date]),"dd/mm/yyyy")
It is returning
10/01/2009 instead of 01/10/2009
for dates greater than 12, it is returning correct result like
10/13/2009 returns 13/10/2009
Any idea on how to fix this.
Using Access 2003.
Thanks
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.