A Repasky

A Repasky

  • NA
  • 231
  • 183.7k

CASE WHEN problem

Apr 16 2013 9:14 PM


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)