General information
Title:
Can you nest CASE statements in SPT for SQL 7
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
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