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.
| Author |
Topic |
|
BadBoy House
Starting Member
41 Posts |
Posted - 2010-05-25 : 13:20:36
|
| Hi all.We have a field in our SQL database called Year End. It's a standard date field which contains the year end dates for our clients.I want to alter just the year part of the date - leaving the day and month part as they are.There are about 1000 clients on the database and each has a different date/year. I need to set the year for each client to be 2010. The dd/mm part must remain as it is.Can anyone tell me how to do this via a query? I'll need to repeat this each year for the correct year.Thanks in advance! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
BadBoy House
Starting Member
41 Posts |
Posted - 2010-05-26 : 03:32:27
|
| And will that set the year to 2010 on EVERY date in the year_end field? |
 |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2010-05-26 : 03:45:03
|
| why don't you experiment with the advice given? Tara has a very good track record here when it comes to giving good advice.begin transaction your new code here select * from yourtableview the output!and then put in a "rollback transaction" or "commit transaction" depending on whether or not the code worked!!! |
 |
|
|
|
|
|