I am trying to extract an amount of years from a specific date for this the correct syntax is
<date> - interval '5 years';
But I dont want to extract a specific amount of years but a variable, which user will provide as a parameter. I have tried the following the variable name is years :
date+interval '% years',years;
I am getting an error and it doesn’t let me do it that way. What would be the right way to do it.
I believe you should be able to write:
(Disclaimer: not tested, and it’s been more than a year since I last did this sort of thing.)