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


.
 

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

Similar Threads


Back
Top