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 |
|
sqldba20
Posting Yak Master
183 Posts |
Posted - 2008-01-09 : 10:30:28
|
| Folks:I need help with a date time conversion. I am running this below SQL to get Fifteen Days Old date but I need the time format in 00:00:00.000 instead of the actual current time.declare @FifteenDays datetimeSELECT @FifteenDays = DATEADD(DAY, -15, CURRENT_TIMESTAMP)select @FifteenDaysOutput I Get:-------------2007-12-25 10:29:27.903Output Expected:----------------2007-12-25 00:00:00.000Thanks ! |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2008-01-09 : 10:34:50
|
| select dateadd(day,datediff(day,0,current_timestamp)-15,0)CODO ERGO SUM |
 |
|
|
|
|
|