Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SUMIF Columns

James LangranMay 24 2019 — edited May 30 2019

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

This post has been answered by fac586 on May 24 2019
Jump to Answer
Comments
Post Details
Added on May 24 2019
4 comments
1,160 views