Solved

Adjust Date in Field

Posted on 2009-07-02
2
166 Views
Last Modified: 2012-05-07
I have a table myTable.  It has a field myDateField.  There are thousands of records in the table.

I need a query that will update the year portion of the dates in myDateField by adding 4 years.  For example, if the value is 6/1/2005, I need to update it to 6/1/2009.
0
Comment
Question by:wsturdev
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
Comment Utility
update urtable
Set myDateField = DATEADD(year, 4, myDateField)
WHERE myDateField is not null
0
 
LVL 1

Author Closing Comment

by:wsturdev
Comment Utility
Perfect!  Thanks.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Oracle SQL Select Statement 19 58
MS Access Add A Yes/No Box to Each Record 5 41
Oracle Pivot 2 32
Access left join query 5 31
In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now