Click here to Skip to main content
15,890,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Need to introduce the following in addition to the 'OPENED'

'CLOSED'

'UNRESOLVED'



IF @CINCIDENT <>'ALL'
BEGIN
IF @CINCIDENT = 'OPENED'
SET @sql = @sql + ' AND A.COMP_DATE+P.PROD_SERV_TAT >= GETDATE()'
ELSE
SET @sql = @sql + ' AND A.COMP_DATE+P.PROD_SERV_TAT < GETDATE()'
END




How do I incorporate 'CLOSED', 'UNRESOLVED' in the above program segment


Thanks

What I have tried:

This is an on-going developement
Posted
Updated 16-Apr-18 22:05pm

1 solution

It depends what exactly you mean with "incorporate", but you'll probably want to check for CLOSED/UNRESOLVED in the ELSE IF:

SQL
ELSE IF @CINCIDENT = 'CLOSED' 

and
SQL
ELSE IF @CINCIDENT = 'UNRESOLVED' 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900