Okay, I'm drawing a blank on this one.
I need to check several fields in the database and based on the criteria, return 2 fields in my select statement.
For instance, I have this CASE statement (this is just a small sampling of it):
CASE --Determine the Category
WHEN Disposition = 'GROUP' and Error_Code is null
THEN 'Group'
WHEN Disposition ='UNREPRICED' and Error_Code is null
THEN 'Provider'
WHEN Disposition = 'AUDITOR' and Error_Code is null
THEN 'Auditor'
ELSE 'Ready'
END AS Category
But I would also like to return a field called 'Stage' as well. In other words, all records with a Category of 'Group' would have a 'Stage' = 'Processed', all records with a Category of 'Provider' would have a 'Stage'= 'Complete' and all records with a Category of 'Auditor' or 'Ready' need to return a 'Stage' = 'Outbound'
What is the best way to do this?
I need to check several fields in the database and based on the criteria, return 2 fields in my select statement.
For instance, I have this CASE statement (this is just a small sampling of it):
CASE --Determine the Category
WHEN Disposition = 'GROUP' and Error_Code is null
THEN 'Group'
WHEN Disposition ='UNREPRICED' and Error_Code is null
THEN 'Provider'
WHEN Disposition = 'AUDITOR' and Error_Code is null
THEN 'Auditor'
ELSE 'Ready'
END AS Category
But I would also like to return a field called 'Stage' as well. In other words, all records with a Category of 'Group' would have a 'Stage' = 'Processed', all records with a Category of 'Provider' would have a 'Stage'= 'Complete' and all records with a Category of 'Auditor' or 'Ready' need to return a 'Stage' = 'Outbound'
What is the best way to do this?