Hi all. This is my initial question....well I got a response but I'm still stuck. Can anyone please explain how can I achieve this in mysql:
I have two fields in mysql, 'cap_commdate
' with DATE TYPE and 'cap_policyterm
' with INT TYPE. I want to have another field called 'cap_maturityDate
' which will automatically compute the policy term pereod in years (in layman's term ie: cap_commdate*cap_policyterm
). What is the right SQL query to use; or what is the best approach; and I want to use it in my recordset to prepare a confirmation page... please a simple explanation...
I have tried the following:
SELECT DATE_ADD(cap_commdate, INTERVAL cap_policyterm YEAR) ...
I ran the query and got errors; so i edited it and used:
SELECT
DATE_ADD("cap_commdate", INTERVAL "cap_policyterm" YEAR) AS cap_maturity FROM capital
All I got was empty fields. Please help out.