Calculating Time (additive amounts)

by Evan   Last Updated June 13, 2019 02:22 AM

In QGIS 3.6.1 Noosa I have a column in the attribute table (Install Date) formatted as DATE that I want to add 100 or 60 years (Replacement Date) to, also in DATE format, for use in Time Manager.

I have tried creating a new field in the Field Calculator but get NULL values out. Expression used was todate("Install_Da"+'100 Years").

I can get a result using Integer formats using left(Install_Da,4) then another column adding 100 years but then it doesn't run in Time Manager due to wrong format.

What is the proper way to add years to a date?

Tags : qgis

Answers 1

You need to change the 60 or 100 years to an interval:

"Install_Da" + to_interval('60 years')
June 13, 2019 01:56 AM

Related Questions

Updated March 05, 2018 09:22 AM

Updated May 24, 2018 16:22 PM

Updated August 12, 2018 02:22 AM

Updated June 30, 2015 17:11 PM

Updated April 15, 2017 09:22 AM