In this video we will show you how to quickly calculate the number of days in a given date range and display the value as a page item in Oracle APEX.
To illustrate this we will start by creating a display only page item. Once created we will generate a dynamic action that fires on page load, with a true action of type SQL expression. Inside the SQL expression we will leverage Oracle Autonomous Transaction Processing to quickly generate the number of days in the time period and set the page item to the results. Example sql expression syntax below.
with time_between as (select timestamp'2021-11-30 00:00:00'-timestamp'2021-09-01 00:00:00' t from dual) select extract ( day from t ) chip_is_awesome from time_between;