Updating dates

  • Thread starter Thread starter Connie
  • Start date Start date
C

Connie

I would like to use an update query to change a previous
year to this year. The month and day need to stay the
same, only the year is to update.

Any help appreciated.

Connie
 
Asuuming you only want to change "last" year to "this" year but "this" year
is variable, e.g. in 2005, "this" year is 2005:

UPDATE [YourTable]
SET [DateField] =
DateSerial(Year(Date()), Month([DateField]), Day([DateField])
WHERE Year([DateField]) = Year(Date())
 
Thanks. I'll give it a try
-----Original Message-----
Asuuming you only want to change "last" year to "this" year but "this" year
is variable, e.g. in 2005, "this" year is 2005:

UPDATE [YourTable]
SET [DateField] =
DateSerial(Year(Date()), Month([DateField]), Day ([DateField])
WHERE Year([DateField]) = Year(Date())

--
HTH
Van T. Dinh
MVP (Access)




I would like to use an update query to change a previous
year to this year. The month and day need to stay the
same, only the year is to update.

Any help appreciated.

Connie


.
 
It worked beautifully much thanks!!
-----Original Message-----
Asuuming you only want to change "last" year to "this" year but "this" year
is variable, e.g. in 2005, "this" year is 2005:

UPDATE [YourTable]
SET [DateField] =
DateSerial(Year(Date()), Month([DateField]), Day ([DateField])
WHERE Year([DateField]) = Year(Date())

--
HTH
Van T. Dinh
MVP (Access)




I would like to use an update query to change a previous
year to this year. The month and day need to stay the
same, only the year is to update.

Any help appreciated.

Connie


.
 
Back
Top