Query Mulitiple Select/Case
Posted on 2014-12-07
I want to create a query as follows. I need help setting put case and select correctly. The below query is more pseudocode than an actual working query.
declare variable @response
set @response = 'User will enter a value'
when @response = 'Standard' THEN
Select NameFirst, NameLast,Status
when @response = 'Extended' THEN
Select NameFirst, NameLast,Status,DateJoin,Comments
when @response = 'Restricted'
Select NameFirst, NameLast,Status,DateJoin,Comments,Address,Phone,Email