Remove minutes, seconds from date field

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a query that is doing a group by multiple fields.
One of the fields is a date which has the same day value,
but different minutes, seconds. I would like to basically
truncate the minutes and seconds off the date so it
basically groups just by the day.

Is there an easy way to do this with a built in function?
I saw some references to a convert function, but there
were not any good examples of the syntax.

Thanks,

Dave
 
Dave said:
I have a query that is doing a group by multiple fields.
One of the fields is a date which has the same day value,
but different minutes, seconds. I would like to basically
truncate the minutes and seconds off the date so it
basically groups just by the day.

Is there an easy way to do this with a built in function?
I saw some references to a convert function, but there
were not any good examples of the syntax.

DateValue(YourDateField)
or
Fix(YourDateField)
or
Format(YourDateField,"yyyy-mm-dd")

The last could obviously use any date format string that did not include
the time.
 
Thanks to all for the suggestions. Since I wanted the
hours included I ended up using the format function with a
mask. It worked exactly for what I needed.

Again,

Thanks
 
Back
Top