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
 how to update datepart day

Author  Topic 

sonial8
Starting Member

5 Posts

Posted - 2009-09-28 : 15:18:31
How would I update a date part day in the table.

I want to update all records for an id where date is 2009-07-25:00:00.. to July 30, I want to retain the timestamp hence only want to update the day portion of the date.

update tablename set datepart(dd, name of column)??

Thanks in advance.
Sonia

sonia

sonia

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-09-28 : 15:22:28
Duplicate, locking thread: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=133563

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -