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 |
|
dsscholar
Starting Member
6 Posts |
Posted - 2011-09-27 : 05:38:34
|
| Hi all,I have a timestamp in the format of 12-12-2011 10:12:12. I want to convert it into 12-12-2011 00:00:00. How to do this in sql server.Thanks in advance. |
|
|
Ranjit.ileni
Posting Yak Master
183 Posts |
Posted - 2011-09-27 : 05:43:27
|
| I am not sure, Is this work out?select left('12-12-2011 10:12:12',10)+' 00:00:00'or select left('12-12-2011 10:12:12',11)+'00:00:00'--Ranjit |
 |
|
|
vmvadivel
Yak Posting Veteran
69 Posts |
Posted - 2011-09-27 : 06:17:48
|
| --Replace getdate() with your datetime columnSELECT DATEADD(DAY, DATEDIFF(DAY, 0, GETDATE()), 0)Best RegardsVadivelhttp://vadivel.blogspot.com |
 |
|
|
|
|
|