6
Answers

CASE WHEN problem

Ask a question
A Repasky

A Repasky

11y
1k
1


I get an error on the last "as" after the "end" in the statement.  I am not sure what I did wrong.  Can anyone help with this.  My boss said I would not get it.

Thanks for the help ahead of time.
arep


CASE
WHEN ClaimsDetail.AllowedAmt = ClaimsDetail.NotCoveredAmt and ClaimsDetail.NotCoveredAmt != 0 then 'Denied'




else CASE WHEN ClaimsDetail.NetAmt != 0 or ClaimsDetail.CopayAmt != 0 or ClaimsDetail.DeductAmt != 0or (ClaimsDetail.OICPaidAmount != 0 and ClaimsDetail.AllowedAmt != ClaimsDetail.NotCoveredAmt)then 'Paid' else CASE WHEN ClaimsDetail.AllowedAmt = ClaimsDetail.NotCoveredAmt and ClaimsDetail.NotCoveredAmt != 0 then 'Denied'



else CASE WHEN ClaimsDetail.NetAmt != 0 or ClaimsDetail.CopayAmt != 0 or ClaimsDetail.DeductAmt != 0 or (ClaimsDetail.AllowedAmt != 0 and ClaimsDetail.AllowedAmt != ClaimsDetail.NotCoveredAmt)


or (ClaimsDetail.OICPaidAmount != 0 and ClaimsDetail.NotCoveredAmt = 0) then 'Paid' end as ClaimStatus,

Answers (6)