September 23, 2009 at 4:15 pm
This is another way and doesn't use the convert statement:
dateadd(dd, datediff(dd, 0, getdate()), 0)
September 23, 2009 at 11:22 pm
Lynn Pettis (9/23/2009)
This is another way and doesn't use the convert statement:dateadd(dd, datediff(dd, 0, getdate()), 0)
Thanks Lynn,
Got it.
September 23, 2009 at 11:23 pm
Thanks Fausto
September 24, 2009 at 9:11 am
you're welcome
September 25, 2009 at 9:54 am
Wait a second. Is there a reason this data can't be a datatype of datetime?
I have found that this is the fastest way to strip off time, and yet leave it as datetime.
select DATEADD(DAY,DATEDIFF(DAY,0, getdate()),0)
or in your example:
select DATEADD(DAY,DATEDIFF(DAY,0, '2009-09-18 12:54:59.860'),0)
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply