2 Replies Latest reply on Mar 12, 2013 6:28 AM by 996218

# calculate a date from age(num),month(num),days(num)  subtruct by sysdate

form 6i, database 10g xe

i have 3 field age,month and days..they r all number format
if any of this field entered age, month,date or any combination of these three field will return a date that subtruct from sysdate

example:
assuming sysdate= 12-03-13
``````age   month    days  =  date
2                           = 12-03-11
1                = 12-02-13
10   = 02-03-13``````
it may be individual or any combination of age month and days, date will come by subtruct sysdate

Edited by: Selim_Rahman on Mar 11, 2013 10:11 PM

Edited by: Selim_Rahman on Mar 11, 2013 10:12 PM
• ###### 1. Re: calculate a date from age(num),month(num),days(num)  subtruct by sysdate
This is sql related problem. Post at {forum:id=75}
• ###### 2. Re: calculate a date from age(num),month(num),days(num)  subtruct by sysdate
Hi Selim_Rahman ,

Use the below query.

select add_months(add_months(sysdate ,- NVL(:P_MONTHS,0)) - NVL(:P_DAYS,0),- NVL(:P_AGE,0)*12) da
from dual;

Regards
Sambasiva Reddy.K
samba.komma@gmail.com
1 person found this helpful