Solved Change Year Only (1 Viewer)

Tieval

Still Clueless
Local time
Today, 11:46
Joined
Jun 26, 2015
Messages
475
Simple question, I have a lot of data with date/time in a field. All the data is for 2020 but I want to change it to 2019.

10/02/20 11:09:53 becomes 10/02/19 11:09:53
10/02/20 13:48:08 Becomes 10/02/19 13:48:08

Effectively a query that looks up all the dates and just changes the year, not the day, month and time.

Any help would be greatly appreciated.
 

Minty

AWF VIP
Local time
Today, 11:46
Joined
Jul 26, 2013
Messages
10,355
For a really simple guess I would try using
[YourDateFIeld] = DateAdd("yyyy", -1, "[YourDatefield])
 

Ranman256

Well-known member
Local time
Today, 07:46
Joined
Apr 9, 2015
Messages
4,339
Where year(dateFld)= 2020,

Change to: DateAdd("yyyy",-1,dateFld)
 

Tieval

Still Clueless
Local time
Today, 11:46
Joined
Jun 26, 2015
Messages
475
Many thanks, that was easy. I was being a bit stupid and trying to extract the DataPart from it and then put it back. (y)
 

Users who are viewing this thread

Top Bottom