Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select uploadid,EntryMode
from uploads 
where
CASE
  WHEN @EntryMode='All' THEN EntryMode is not null
  WHEN @EntryMode='App' THEN EntryMode is null
  ELSE EntryMode =@EntryMode
END
Posted
Comments
CPallini 7-Oct-15 2:43am    
OK, your code syntax is apparently wrong. What do you want to do (tah is what should be the result?)?
Prakash Kanwar 7-Oct-15 2:46am    
please help me to correct syntax
Maciej Los 7-Oct-15 2:45am    
Take a look at your CASE statement, think of it and correct.
Member 12003400 7-Oct-15 2:47am    
Your case statement syntax is wrong. and what is @EntryMode,,it's not defined.

1 solution

Try:
SQL
WHERE (@EntryMode='All' AND EntryMode is not null) OR
      (@EntryMode='App' AND EntryMode is null) OR
       @EntryMode = EntryMode
 
Share this answer
 
Comments
CPallini 7-Oct-15 4:42am    
5.Looks good.

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