• nakache (4/6/2010)


    the fastest way to remove time from datetime is:

    select CONVERT(datetime,floor(convert(float,getdate())))

    Itzik Ben-Gan had a big post on Date Manipulation with benchmarking..(long time ago..)

    I believe this is the article you were referring to? In there, he actually mentions that his favorite technique is the DADD method, although his tests show casting as an int to be very slightly faster.

    Here's a performance evaluation[/url] by Gail Shaw on her blog of the different methods.

    I won't make any claims as to which of these is faster, I'm sure they each win on occasion, but for the versatility, I'll stick with Dateadd/Datediff.

    Seth Phelabaum


    Consistency is only a virtue if you're not a screwup. 😉

    Links: How to Post Sample Data[/url] :: Running Totals[/url] :: Tally Table[/url] :: Cross Tabs/Pivots[/url] :: String Concatenation[/url]