Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 nested if-else

Author  Topic 

shemayb
Posting Yak Master

159 Posts

Posted - 2007-07-24 : 00:11:00
I have to choose four items in the drop down list for insurance: Med1,Med2,Med3,All. How would i structure it as an if else.If the insurance selected is Med1,only records from Med1 will be displayed.

thanks!

Funnyfrog

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-24 : 02:25:19
SELECT *
FROM Table1
WHERE COALESCE(NULLIF(@Param, 'All'), Col1) = Col1


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -