I am trying to get the difference between 2 date time field into 3rd field in apex form.
the date time fields are defined as date format in the table with the format 'mm/dd/yyyy hh24:mi' and the result field is number.
I created a dynamic action and executing a pl sql code where page items to submit are my 2 date fields and page item to return is the field 3
my code is
SELECT to_char(:ITEM_1, 'mm'dd'yyyy hh24:mi') - to_Char(:ITEM_2,'mm/dd/yyyy hh24:mi')*24*60 INTO :ITEM_3 from tbl A as I read that apex treats all page item as varchar2 but I am getting an error
"AJAX call returned server error ORA-01722: invalid number for Execute Pl/SQL code"
What am I doing wrong?
Thanks,
Blyzz