Hi All,
This idea is to have a function for date which will take input as three parameters.
name of the function can be DIFF_DATES (DATE1 WITH TIME STAMP, DATE2 WITH TIME STAMP, OPTIONAL PARAMETER) -> If we pass input as date1 and date2 and third paramter as 'D' then the function should return output as difference between two dates in days.
below table will give a clear idea:
Parameter1 | Parameter2 | Parameter | Output |
---|
23-MAY-2016 | 22-MAY-2016 | DAYS | 1D |
23-MAY-2016 | 22-APR-2016 | MONTHS | 1 Month / 30 days |
23-MAY-2016 | 22-MAY-2015 | YEARS | 1 year / 12 months / 365 days |
23-MAY-2016 22:10:00 | 23-MAY-2016 22:40:15 | MINUTES | 20MINUTES 15 SECONDS |
| | | |
| | | |
This queries were asked several times by many of the developers
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:96012348060
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:5931515900346288940
Please let us know whether you would like to have support for SQL date function which will help in reducing the customized functions and also as this is the most important and used function in a day to day life. @"connor"