my query is creating issue in prd
I TRied to make a custom report but when i try to import and run in prd
can u suggest whats wrong coz my query is working as preview
SELECT DISTINCT s.STUD_ID AS USER_ID,
ROUND(SUM(e.TOTAL_HRS,2) as DECIMAL (15,0)) AS Total_Hours,
ROUND(SUM(e.CPE_HRS,2) as DECIMAL (15,0)) AS CPE_Hours,
s.lname,
s.fname ,
s.EMAIL_ADDR ,
o.ORG_ID ,
o.ORG_DESC ,
(select su.user_value from pa_stud_user su where col_num = 10 and s.stud_id = su.stud_id) as "Board Unit",
(select su.user_value from pa_stud_user su where col_num = 20 and s.stud_id = su.stud_id) as "Employing Entity"
FROM pa_student s,
PA_CPNT_EVTHST e ,
PA_ORG o
WHERE e.STUD_ID = s.STUD_ID
AND s.ORG_ID = o.ORG_ID
AND o.ORG_ID (+) = s.ORG_ID
GROUP BY s.STUD_ID ,s.lname,s.fname ,s.EMAIL_ADDR ,o.ORG_ID ,o.ORG_DESC
UNION ALL
SELECT DISTINCT s.STUD_ID AS USER_ID,
ROUND (SUM(e.TOTAL_HRS,2) as DECIMAL (15,0)) AS Total_Hours,
ROUND (SUM(e.CPE_HRS,2) as DECIMAL (15,0)) AS CPE_Hours,
s.lname,
s.fname,
s.EMAIL_ADDR,
o.ORG_ID,
o.ORG_DESC,
(select su.user_value from pa_stud_user su where col_num = 10 and s.stud_id = su.stud_id) as "Board Unit",
(select su.user_value from pa_stud_user su where col_num = 20 and s.stud_id = su.stud_id) as "Employing Entity"
FROM pa_student s,
PA_XCPNT_EVTHST e,
PA_ORG o
WHERE e.STUD_ID = s.STUD_ID
AND s.ORG_ID = o.ORG_ID
AND o.ORG_ID (+) = s.ORG_ID
GROUP BY s.STUD_ID ,s.lname,s.fname ,s.EMAIL_ADDR , o.ORG_ID ,o.ORG_DESC
/** and s.stud_id in [UserSearch]
and [security:pa_student s] */