Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i need a query for this pls help to solve this problem
Posted
Comments
[no name] 7-May-15 1:50am    
can u provide more details,question is not clear.if u want dd/mm/yyyy to mm/dd/yyyy format ?

If the column is of type datetime, this is what you can do
SQL
UPDATE myTable SET myDateColumn = DATEADD(YEAR, -2, myDateColumn);

Here -2 is subtracted from the year. You can do your own manipulation.
 
Share this answer
 
Hi,

Based on your requirement check the Solution 1 and try the below ref also.

1) How do you update only the year in and keep day and month - sql server

2) How to change only the year of a date datatype
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900