Changing the Year in Date Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have to keep the same months and days in my current Date Field. However I
must make all the new dates show the year 2005. The dates I have are all
different.

Expr1: DatePart("m",[HSchool]![HCLBKDT]) & DatePart("d",[HSchool]![HCLBKDT])
& DatePart("yyyy",2005)

The above code is what I have now, but the year comes out 1905.

Does anyone know how to do this in a query?

Thanx

Len
 
Len said:
I have to keep the same months and days in my current Date Field.
However I must make all the new dates show the year 2005. The dates
I have are all different.

Expr1: DatePart("m",[HSchool]![HCLBKDT]) &
DatePart("d",[HSchool]![HCLBKDT]) & DatePart("yyyy",2005)

The above code is what I have now, but the year comes out 1905.

Does anyone know how to do this in a query?

Thanx

Len

Use DateAdd() function in an update query to add one year to all existing
values.
 
Try using the DateSerial function to build a new date.

Something along the lines of
DateSerial(2005,Month([YourDateField]),Day([YourDateField]))

You don't say whether you are trying to create new values (dates) or display old
values (dates) as the year 2005 or change your current date values to all be in
2005 permanently. So the general advice above is all I can supply.
 
Back
Top