Update query

  • Thread starter Thread starter marconi86
  • Start date Start date
M

marconi86

I have a some records with the date "mm/dd/2005" and I need to update
the dates to be "mm/dd/2006". I only need to update the year. Any
help on a query to perform this function?
 
Would it be enough to add 1 year? If so, take a look at the DateAdd()
function/syntax in Access HELP.

Another approach, but more complex, would be to use the DateSerial()
function to force the year portion to be 2006. (also available via Access
HELP)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
I have a some records with the date "mm/dd/2005" and I need to update
the dates to be "mm/dd/2006". I only need to update the year. Any
help on a query to perform this function?

UPDATE TableName
SET FieldName = DateAdd("yyyy", 1, FieldName)
WHERE FieldName >= #2005-01-01#
AND FieldName < #2006-01-01#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top