0

I have tried to use the following in PostgreSQL but it adds about 2000 years to the year. I am needing to change the year from 2096 to 2001 or 2000 doesn't really matter. When I run this it adds about 2000 years to the year 2096 and makes it 4096.

UPDATE module_warrants 
  SET receiveddate = receiveddate + MAKE_INTERVAL(YEARS :=2096 -96) 
where receiveddate >= '01-01-2094'

Expect the year to decrease by 96 years to 2000 from 2096.

Progman
  • 16,827
  • 6
  • 33
  • 48
Blake
  • 1
  • 2

1 Answers1

0

The expression + MAKE_INTERVAL(YEARS :=2096 -96) is adding 2000 years (2096-96) to the current value.

But you want to subtract the number:

receiveddate - make_interval(years => 96)

or

receiveddate - interval '96 years'