Faster way to get the date without time

DECLARE  @day DATETIME
SET
@day = ’12/12/2009 09:25:00′

SELECT dateadd(dd,datediff(dd,0,@day),0)

used in : http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64755

There is other info about date converions here.
Date/Time Info and Script Links
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64762

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s