How can you update Datepart day

Please support our MS SQL advertiser: Intel Parallel Studio Home
Reply

Join Date: Sep 2009
Posts: 3
Reputation: sonial8 is an unknown quantity at this point 
Solved Threads: 0
sonial8 sonial8 is offline Offline
Newbie Poster

How can you update Datepart day

 
0
  #1
Sep 28th, 2009
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
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,215
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 573
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: How can you update Datepart day

 
0
  #2
Sep 28th, 2009
What happens if the date is '2009-08-01', does it go back to 7/30 or does it go to 8/30?
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

Tags
datepart, update

Message:



Similar Threads
Other Threads in the MS SQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC