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!

Cannot successfully use date-picker value in Source SQL Query in APEX

Peter KatongoleJan 15 2022

Hi everyone,
I am relatively a newbie to apex and need some help. How can I successfully make the dynamic action to work.
I have a table with a date column named "reg_date". The date format is MM/DD/YYYY.
In APEX I have a page with a classic report and 2 date picker items. One is a "Fromdate" and the other "Todate". I want use the 2 date-picker items to filter the classic report with a dynamic action. The dynamic action is to refresh the classic report when the start-date is changed.
This is the SQL Query in the source section of the region but it doesn't work. When I change the dates in the date-picker the report doesn't display.
select ID, FIRST_NAME, LAST_NAME, GENDER, REG_DATE from TEST_TABLE where TO_CHAR(REG_DATE,'MM/DD/YYYY') BETWEEN :P2_FROMDATE AND :P2_TODATE ORDER BY TRUNC(REG_DATE) DESC;

This post has been answered by Hamza Al-abbasi on Jan 15 2022
Jump to Answer
Comments
Post Details
Added on Jan 15 2022
3 comments
2,133 views