Page 1 of 1

Adding 18 months to a date

Posted: 2020-04-09 15:35
by jangle
I have searched but did not really find anything to solve my problem.

I have a date field in a table, and I have a date field that is readonly (calculated field) with the following statement.

Code: Select all

SELECT Election_Date from Elections ADDDATE(Election_Date, INTERVAL 18 MONTH) 
The date does not add....

An help appreciated….

Thanks!!

Re: Adding 18 months to a date

Posted: 2020-04-09 21:25
by pbottcher
Hi

Try

SELECT ADDDATE(Election_Date, INTERVAL 18 MONTH)_Date from Elections

But you should add you PK identifier to get only the record you are looking for.

Somethink like:

SELECT ADDDATE(Election_Date, INTERVAL 18 MONTH)_Date from Elections where ID = ...

Re: Adding 18 months to a date

Posted: 2020-04-10 13:32
by jangle
Perfect Perfect!!!

Thanks!!!