Forum Discussion
Tim Hunter
Jul 03, 2019Steel Contributor
CASE Statement
I am a SQL novice. Our SQL expert is unavailable and I need to make some small changes to a stored procedure, any help would be appreciated.
So I have a stored procedure that pulls the data into an Excel spreadsheet. Here is what the output looks like:
What I am trying to accomplish is when the % is 0 or the Incentive is blank, I want the Pay column to be a 0. Attached is the query for the stored procedure. At the end of the code, you will see the CASE statements for the columns. Thank you!!
- thanos7Copper Contributor
You can use a case statement in Pay column something like that
case when (se <1 or ty =3 or yr =0 or st ='OUT') then 0 else py end