You will have to enter the literal values. Does that work?
SELECT numofdays(:P160_DKTNR,:P160_PAYOFF_DATE) FROM DUAL;
But, what are vrecdate and vlastdate in APEX? How do they get a value? I'd expect a syntax error. I'm not sure how it can identify these.
SELECT numofdays(vrecdate,vlastdate) FROM DUAL;
It returns the number of days to the :P160_DAYS item on page load. But I need to be able to select a date for the :P160_PAYOFF_DATE item using the date picker. Nothing happens when I do that. I created a dynamic action to refresh :P160_DAYS when there is a change in the payoff_date item, but nothing happened.
declare vdays number(4); vlastdate date; vcurdate date; cursor getdate_cur is select prindate from ffmisc where dktnr = :P160_DKTNR; begin open getdate_cur; fetch getdate_cur into vlastdate; close getdate_cur; vcurdate := :P160_PAYOFF_DATE; vdays := to_date(vcurdate) - to_date(vlastdate); RETURN (vdays); end;