Remove minutes, seconds from date field

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
 
R

Rick Brandt

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.
 
D

dAVE

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
 

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