Hi,
I'm trying to create a classic report with SUM's based on conditions. If it was one condition I could put in the WHERE statement but not sure how to do multiple conditions like I'd do a SUMIF in EXCEl. Below is what I'm trying to get right to create a column summing hours
in the past and another summing the future
select
RESOURCE_NAME,
count(*) total,
sum(hours if (DATE >SYSDATE)) Planned Hours,
sum(hours if (DATE <SYSDATE)) Completed Hours
from
DROP_ME
WHERE
CUSTOMER like :P4_CUSTOMER
or
:P4_CUSTOMER is null
group
by RESOURCE_NAME
order
by 2 desc