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.
Author |
Topic |
venkath
Posting Yak Master
202 Posts |
Posted - 2008-02-05 : 09:46:47
|
Hi allI need to display date values in 24 hours format and the minutes and seconds in the date value should be replaced with 00:00 getdate() - 2008-02-05 20:12:51.413 value should be displayed as2008-02-05 20:00:00.000Thanks in advance. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-02-05 : 09:48:49
|
SELECT DATEADD(DAY, DATEDIFF(DAY, '19000101', GETDATE()), '19000101'),DATEADD(HOUR, DATEDIFF(HOUR, '19000101', GETDATE()), '19000101'),DATEADD(MINUTE, DATEDIFF(MINUTE, '19000101', GETDATE()), '19000101') E 12°55'05.25"N 56°04'39.16" |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-02-05 : 09:48:54
|
DATEADD(d,DATEDIFF(d,0,GETDATE()),0) |
 |
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-02-05 : 10:48:50
|
[code]select DT = dateadd(hh,datediff(hh,0,getdate()),0)Results:DT ------------------------------------------------------ 2008-02-05 10:00:00.000(1 row(s) affected)[code]CODO ERGO SUM |
 |
|
|
|
|
|
|