Quote from: nrhodes00 on 31 Aug 2011 02:21:40 PM
Not sure what i'm missing
(if ([Coverage Option 2] is missing))
then([Coverage Option 3]))
(if ([Coverage Option 3] is missing)
then ([Coverage Option 2]))
(if ([Coverage Option 2] is missing and [Coverage Option 3]is missing)
then ([Coverage Option Code]) )
else ('xxxx')
As RA says above, but you also need to be aware that expressions get evaluated in the order in which you declare them, and once a True result is found, no further processing occurs. This would mean that you could have a situation where both Coverage Option 3 and Coverage Option 2 are missing, but the expression returns Coverage Option 3 (a null) because the first expression would evaluate as True.
You should probably rearrange the order to check for both Coverage Option 2 and Coverage Option 3 missing in the first expression:
case
when ( [Coverage Option 2] is missing and [Coverage Option 3] is missing) then ([Coverage Option Code])
when ( [Coverage Option 2] is missing) then ([Coverage Option 3])
when ( [Coverage Option 3] is missing) then ([Coverage Option 2])
else ('xxxx')
end
or alternatively:
if ([Coverage Option 2] is missing and [Coverage Option 3] is missing) then ([Coverage Option Code]) else if ([Coverage Option 2] is missing) then ([Coverage Option 3]) else if ([Coverage Option 3] is missing) then ([Coverage Option 2]) else ('xxxx')
Regards,
MF.