Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uodate a Date Field

Status
Not open for further replies.

Brogrim

Technical User
Jul 28, 2000
184
IE
Hi everyone

I imported a text file and it changed all the dates from 1900s to 2000s. Can I build a query to break the date into day and month and year. I then want to run an update query that any date in the 2000s goes back to 1900

Thanks
 
UPDATE yourTable SET yourDateField=DateAdd('yyyy',-100,yourDateField)
WHERE Year(yourDateField)=2000;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Excellent, worked perfectly. Thanks once again Tek Tips to the rescue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top