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
 getdate format

Author  Topic 

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-08-22 : 10:27:29
How can I convert value from getdate() function to following format?
2006-06-20 00:00:00

2006-06-20 10:25:55.063 to 2006-06-20 00:00:00

Thanks

Sanjeev Shrestha
12/17/1971

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2006-08-22 : 10:32:14
SELECT DATEADD(d, DATEDIFF(d, 0, GetDate()), 0)



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

sanjnep
Posting Yak Master

191 Posts

Posted - 2006-08-22 : 10:33:55
Thanks

Sanjeev Shrestha
12/17/1971
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-08-26 : 04:17:42
Just for clarity, I prefer using
SELECT DATEADD(day, DATEDIFF(day, 0, GetDate()), 0)

Is 12/17/1971 your BirthDate?

Madhivanan

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

- Advertisement -