I have 2 separate case statements which are producing the correct results:
Case when A_staff_Service_Type.type = 'v'
then isnull(Indirect_Duration,0)/60.00 else null end
The above produces 6.5 for 1 employee.
Case when pt_service.service_code = 'N06 '
then isnull(direct_Duration,0)/60.00 else null End
The above produces 5.5 for the same employee.
So I have two separate outputs of 6.5 and 5.5. What I would like is the output to be 12. I have tried
Case when A_staff_Service_Type.type = 'v' then isnull(Indirect_Duration,0)/60.00 else null end +
Case when pt_service.service_code = 'N06 ' then isnull(direct_Duration,0)/60.00 else null End
But the above results in 0 instead of 12.
This is a query writer within a clinical application based on SQL Server 2008.
A
yields6.5
and expressionB
yields5.5
, then the expressionA+B
will yield12.0
. No way it can show0
.