Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Calculate the number of days between two dates

User_7NA46Jun 17 2022 — edited Jun 17 2022

Hi APEX Team,
I have two items, a field of Start date, it's a date picker type (:P3_Start_Date) and End Date also (:P3_End_Date), i want to add a third field which is Number of date (:P3_Number_of_Days), after setting the Start Date and the End Date, when the user click on the field of Number of date, it wil automatically calculate the difference in days between these two dates.
For example, when the user put in Start date 15/06/2022, and in End Date 17/06/2022, once he clicks on Number of days, it displays 2 in the field automatically
I tried a Dynamic Action (with true action click), i testedJavaScript Expressions like Math.ceil(Math.abs($v("P3_DATE_FIN") - $v("P3_DATE_DEBUT") )/(1000*60*60*24)), i tried also different sql statements but that does not work.
Any help?

Comments
Post Details
Added on Jun 17 2022
7 comments
8,049 views