How to remove minutes and seconds from DateTime?

  • dwain.c (3/28/2012)


    Lynn - Looks like the third (hidden) line on my last post!

    Yep, missed it.

  • This worked for me just great

    thanks

  • Got a bit messier than I was hoping for:

    SELECT DATEADD(Hour, DATEPART(hour, GETDATE()), CAST(CAST(GETDATE() AS DATE) AS DATETIME))



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Try this

    select dateadd(minute, datediff(minute, 0, yourcolumn), 0) from yourtable

Viewing 4 posts - 16 through 18 (of 18 total)

You must be logged in to reply to this topic. Login to reply