Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 DATE FUNCTION

Author  Topic 

vasu4us
Posting Yak Master

102 Posts

Posted - 2006-06-08 : 10:08:33
HOW TO CONVERT THE VALUES IN DATETIME COLUMN FOR EX

2006-03-17 03:56:00.000
TO
2006-03-17 00:00:00.000

I HAVE TO COMPARE ONLY DATE TO EXTRACT REPORTS.

THANKS IN ADV


madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-08 : 10:10:12
Select DateAdd(day,DateDiff(day,0,Datecolumn),0) from yourTable

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-08 : 10:11:00
[code]select dateadd(day, datediff(day, 0, datecoumn), 0)[/code]



KH

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-08 : 10:11:51
Damn ! slower again


KH

Go to Top of Page

vasu4us
Posting Yak Master

102 Posts

Posted - 2006-06-08 : 10:23:08
HAY THANKS ALL IT WORKS, THIS HELPES ME IN COMPARING A LOT OF TABLES WITH RESPECT TO TIME DIMENSION THANKS ALOT
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-08 : 10:25:09
Also read this
http://www.sql-server-performance.com/fk_datetime.asp

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2006-06-08 : 10:55:03
There are various date conversion links here.

Date/Time Info and Script Links
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=64762

CODO ERGO SUM
Go to Top of Page
   

- Advertisement -