Adding 18 months to a date

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
jangle
Veteran Member
Posts: 89
Joined: 2020-01-18 17:41

Adding 18 months to a date

Post by jangle » 2020-04-09 15:35

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!!

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1638
Joined: 2018-04-01 10:12

Re: Adding 18 months to a date

Post by pbottcher » 2020-04-09 21:25

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 = ...
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

jangle
Veteran Member
Posts: 89
Joined: 2020-01-18 17:41

Re: Adding 18 months to a date

Post by jangle » 2020-04-10 13:32

Perfect Perfect!!!

Thanks!!!

Post Reply