Hello Everybody,
Sorry for putting incomplete code in my question.
Please help me out, I am still learning SQL. I am asked to make changes to the following command which is developed by another developer.
I have to change the last fourth & third line of the below command as: If the report is run in Jan 2008 or Feb 2008 or Mar 2008 then it should take the "next_perf_review"(database field) date as Mar 31,2008 and if the report is run after Mar 2008 then it take the "next_perf_review"(database field) date as Mar 31,2009.
I have to make a change to this line of code:
AND v.next_perf_review <> TO_DATE ('03/31/'||(to_char(sysdate,'yyyy')+1), 'MM/DD/YYYY')
I greatly appreciate any help. I am using oracle 9i & Crystal reports XI.
--------------------------------------------------
WITH t1 AS
(
SELECT v.company, v.process_level, v.plevelname,
v.department, v.employee, v.last_name, v.first_name, v.middle_init, v.job_code,v.job_class,
v.job_code_description as job_code_title,v.position_title,v.eeo_cat, v.sup_lname,
v.sup_fname, v.sup_middle_init, v.next_perf_review, v.date_hired, v.contract_manager, v.group_name
FROM lrsuser.v_hr_employee v
WHERE v.eeo_cat in (10, 12, 14)
AND v.group_name in ('G:ACTIVE','G:INACTIVE')
AND v.job_class <> '50'
AND v.next_perf_review <> TO_DATE ('03/31/'||(to_char(sysdate,'yyyy')+1), 'MM/DD/YYYY')
AND v.date_hired < TO_DATE ('09/01/'||(to_char(sysdate,'yyyy')), 'MM/DD/YYYY') AND v.fte_total > 0),
---------------------------------------------------------
I replaced the last fourth & third line of the command as follows:
AND (CASE
WHEN to_char(sysdate,'Q') = 1 THEN v.next_perf_review = TO_DATE('03/31/2008','MM/DD/YYYY')
ELSE
v.next_perf_review = TO_DATE('03/31/2009','MM/DD/YYYY')
END)
And I am getting an error as "missing keyword" and I tried this above part of code in TOAD its pointing an error at equal sign in this line - v.next_perf_review = TO_DATE('03/31/2008','MM/DD/YYYY').
Please help me out.
Thanks in advance!!!
gtb