Hi CS,
You do not need to worry about your problem whenever I am their to help you.
Code:
DECLARE
bonus NUMBER(6,2);
empid NUMBER(6) := 120;
hiredate DATE;
BEGIN
-- retrieve the date that employee was hired, the date is checked
-- to determine the amount of the bonus for the employee
SELECT hire_date INTO hiredate FROM employees WHERE employee_id = empid;
IF hiredate > TO_DATE('01-JAN-98') THEN
bonus := 500;
ELSIF hiredate > TO_DATE('01-JAN-96') THEN
bonus := 1000;
ELSE
bonus := 1500;
END IF;
DBMS_OUTPUT.PUT_LINE('Bonus for employee: ' || empid || ' is: ' || bonus );
END;
use like this programming logic for your date requirement.
Bookmarks