943,626 Members | Top Members by Rank

Ad:
  • MS SQL Discussion Thread
  • Unsolved
  • Views: 1828
  • MS SQL RSS
Sep 28th, 2009
0

How can you update Datepart day

Expand Post »
Hi does anyone know how to update a datepart?

update table set datepart(dd, tablename) = '30'
where ??

What I want to do is udpate records date data but only the day
so where all of the records > '2009-07-25 00:00:00.000'
are updated to 30 i.e. 2009-07-30, I want to leave the timestamp portion alone in the records.

Thanks in advance.
Sonia
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sonial8 is offline Offline
3 posts
since Sep 2009
Sep 28th, 2009
0

Re: How can you update Datepart day

What happens if the date is '2009-08-01', does it go back to 7/30 or does it go to 8/30?
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MS SQL Forum Timeline: MSSQL Server problem writing VARBINARY data.
Next Thread in MS SQL Forum Timeline: Anyway to use Having in this SQL STMT?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC