Hi.
We have a custom field called Remaining Hours in Activity Resource Planning that calculates Planned Hours - Reported Hours into a new field. The query works fine for the most part, but we’ve noticed an issue with the field though, where if there are multiple reports under the same Resource Group, but with different Report Codes (e.g WORK & TRAVEL), one of the rows will not calculate properly.

The query itself is as follows:
SELECT (CASE WHEN Qty_Planned IS NOT NULL AND Qty_Used IS NOT NULL THEN (QTY_PLANNED - QTY_USED) ELSE Qty_Planned END)
From ACTIVITY_RESOURCE_PROJ
WHERE RESOURCE_ID=:RESOURCE_ID AND ACTIVITY_SEQ=:ACTIVITY_SEQ
Any help with a solution to this issue would be greatly appreciated.
Thank you!