I receive the following error after attempting to run the program unit below in a report.
REP-1401: 'cf_1' : Fatal PL/SQL error occurred
ORA-06502: PL/SQL: numeric or value error
REP-1401: 'cf_1' : Fatal PL/SQL error occurred
ORA-06502: PL/SQL: numeric or value error
Code:
FUNCTION CF_1 RETURN CHARACTER IS
v_age NUMBER;
v_return CHARACTER;
BEGIN
v_age := TRUNC(SYSDATE) - :sol;
IF v_age < 31 THEN
v_return := 'less than 30';
ELSIF v_age BETWEEN 31 AND 60 THEN
v_return := '60 days out';
ELSIF v_age BETWEEN 61 AND 90 THEN
v_return := '90 days out';
END IF;
RETURN (v_return);
END;