Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you nest CASE statements in SPT for SQL 7
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Can you nest CASE statements in SPT for SQL 7
Miscellaneous
Thread ID:
00258343
Message ID:
00258343
Views:
37
Can you nest a CASE statement within another CASE statement when passing a SPT query to SQL Server 7? I need to determine whether one field is an "A" or "B", then based on that, calculate an amount based on the value in another field. I am trying to do this in one query with something like:

CASE wkdsr.pay_type
WHEN 'FED' THEN
CASE disaster.override1
WHEN 0 THEN wkapp.amt_paid*(disaster.fed_pct/100)
ELSE wkapp.amt_paid*(disaster.override1/100)END AS amt_paid
ELSE
CASE disaster.override2
WHEN 0 THEN wkapp.amt_paid*(disaster.st_pct/100)
ELSE wkapp.amt_paid*(disaster.override2/100) END AS amt_paid

Anyone know something that will work??

Thanks,
Doug
Next
Reply
Map
View

Click here to load this message in the networking platform