I a SP which I have different where clause however I am unable to find the error. Can you please help me or direction on how I can accomplished the same thing
REATE Procedure AIRetrieval @AssocNum bigint, @Criteria as char(1)
as
Select *
from tblAI
Where Case @Criteria
When 'P' then
AssocNum = @AssocNum and DateResolved is null
When 'C' then
AssocNum = @AssocNum and DateResolved is not null
When 'I' then
DateResolved is null
End
GO
REATE Procedure AIRetrieval @AssocNum bigint, @Criteria as char(1)
as
Select *
from tblAI
Where Case @Criteria
When 'P' then
AssocNum = @AssocNum and DateResolved is null
When 'C' then
AssocNum = @AssocNum and DateResolved is not null
When 'I' then
DateResolved is null
End
GO