0

Sorry for the edit...

I am trying to display Only 'Null' option when the user choose @select=2 on the drop down list of Parameters (MS SQL Server Report Builder). The parameter displays the type from watable by querying. The problem is that the table (watable) does not contain null value. Even if it contains the Null, how to display only null option on the drop down list???

    --display type  

    IF @Select = 1
     BEGIN
         SELECT DISTINCT type
         FROM   watable
     END 
    --display null
     --display type  
    IF @Select = 2
     BEGIN
         SELECT DISTINCT type
         FROM   watable
     END 
0

2 Answers 2

2

How about a UNION?

Something like

IF @Select = 1
 BEGIN
     SELECT DISTINCT type
     FROM   watable
     UNION
     SELECT NULL
 END 
Sign up to request clarification or add additional context in comments.

Comments

0

Is this what you need?

--display type  

IF @Select = 1
 BEGIN
     SELECT DISTINCT type
     FROM   watable
     UNION
     SELECT NULL type
 END 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.