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
 Demo data

Author  Topic 

AdamWest
Constraint Violating Yak Guru

360 Posts

Posted - 2011-06-15 : 13:05:38
HI I Have some demo data that is now out of date.
I should like to run a quick sql that will
date the month and bump it up one.
So the column is date created and table is transacions.
datecreated is this: 2010-09-16 00:00:00.000

I guess we have to be careful to not go from month 12 to month 13 though. on that one we have to go to month 01 and the next year. is this an easy one to do and how would you code this?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-06-15 : 13:15:27
Use the DATEADD function, and you won't have this month 13 problem.

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

Subscribe to my blog
Go to Top of Page
   

- Advertisement -