March 26, 2012 at 10:21 pm
Hello every one,
I have data type datetime:
theDate
2012-03-27 11:12:33.073
2012-03-27 12:11:33.075
2012-03-27 13:10:33.076
I want update field theDate to:
theDate
2012-03-27 00:00:00.000
2012-03-27 00:00:00.000
2012-03-27 00:00:00.000
Help me, please.
Thank you very much.
March 26, 2012 at 10:27 pm
Instead of just telling you, how about I point you at one reference that may help you with some of what you are trying to accomplish:
http://www.sqlservercentral.com/blogs/lynnpettis/2009/03/25/some-common-date-routines/
March 26, 2012 at 11:08 pm
Thank you very much, I have done it. 🙂
March 26, 2012 at 11:24 pm
Okay, glad to hear it. Now, you on the other hand, should post the code you wrote to solve your problem. It may help someone else who may have a similar problem, plus it is proper forum etiquette.
March 27, 2012 at 12:26 am
Hi every one, this is my solution.
update table_name
set theDate = dateadd(dd, datediff(dd, 0, theDate), 0)
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply