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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only