changing all the dates in a database

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

I have to update a database by changing the year. Is
there a way I can do it without changing every record
manually?
Thanks,
Pat
 
Hi,

You can use an update query, like this

Update YourTable set DateFld = dateserial(YourNewYear, month(DateFld),
day(datefld))

This query will change year for all dates from field DateFld to YourNewYear

If you want, for example, to change all years to three years after current
year in the field, try this

Update YourTable set DateFld = dateserial(year(DateFld) + 3, month(DateFld),
day(datefld))

If you have more questions, you can contact me.

Good luck,
Bogdan

____________________________________
Independent Consultant
 
Back
Top