I am trying to write a Case When statement with three conditions. The first two are straight forward. The third is a Case when with 4 or conditions:
Case when OE.Category = 'PHA' then
case when P.DirectionID = '.STK-MED' then
[b]case when MOS.ProviderYn = 'Y' then
when MOS.CosignYn = 'Y' then
when OE.OrderDateTime = OEOS.SigDateTime then
when DMU.ProviderID = OE.ProviderID[/b] then 1 else 0 end else 0 else 0 end as TotMedCPOE
As you see if the OE.Gategory = "PHA" and the P.DirectionID = '.STK-MED' no problem. However the third condition can be anyone of 4 to be true. What is the proper syntax for the last condition?