PostgreSQL Subtract exactly a year from a date field PSQL

Viewed 14450

I tried to do SQL Subtract exactly a year but the syntax in PSQL didn't work. In my case dates were imported with 2 digit years so they all have birthdays off by 1900 years.

UPDATE patients SET birthday = dateadd(year, 100, getdate(birthday)

throws:

ERROR:  syntax error at or near "table"
LINE 1: UPDATE table SET datefield = DATE_ADD(datefield, INTERVAL 1 ...
1 Answers
Related