Hi I have the following function created in Oracle. i will have to pass date-1 and date-2 parameters into the function and the function should return the another date to me .
please see the code below.
create or replace function GETD(p_d1 in date,
p_d2 in date ) return DATE
as
l_result DATE;
begin
SELECT EDIT_Date into l_result FROM qa.employees WHERE qa.employee_join_date BETWEEN TO_DATE(p_d1, 'MM/DD/YYYY') AND TO_DATE(p_d2, 'MM/DD/YYYY') AND ROWNUM <= 1
;
return l_result;
end;
i execute the function as below
SELECT GETD('27-JUN-12','28-JUN-12') FROM DUAL
the function get compiled and while im passing the parameters to execute the function i get the following error "Not a Valid Month". Could some one please tell me where im going wrong
thanks Justin