You are right! You can nest CASE statements. After I got your message, I went back and played with it a little more and came up with the following which worked:
CASE field1
WHEN 'A' THEN
CASE field2
WHEN 0 THEN field3*(field4/100)
ELSE field3*(field5/100) END
ELSE CASE field6
WHEN 0 THEN field3*(field7/100)
ELSE field3*(field7/100) END
END AS amt_paid
I had to move the 'AS amt_paid' to the end of the top level CASE statement -- and not use it on the nested case statements.
Thanks for the response -- we are going to need this for many of our reports!
Doug
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement