Click here to Skip to main content
15,894,180 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
SQL
select * from A where (1=1) and case @hour when   72 then Isemailsend72 = 0 else IsEmailsend72=1 end 



this give me error 'Incorrect syntax near '='.'


Thanks.
Posted

1 solution

This way...
SQL
select * from A where (1=1) and Isemailsend72 = case when  @hour = 72 then 0 else 1 end

Happy Coding!
:)
 
Share this answer
 
Comments
ExpertITM 17-Jan-13 3:23am    
Thanks.
Aarti Meswania 17-Jan-13 3:24am    
welcome! :)
Glad to help you! :)
__TR__ 17-Jan-13 3:24am    
+5
Aarti Meswania 17-Jan-13 3:25am    
Thank you! :)

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