Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can you nest CASE statements in SPT for SQL 7
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00258343
Message ID:
00258796
Vues:
10
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
Fil
Voir

Click here to load this message in the networking platform