title: Passing SSRS parameter into Query as parameter
body: <p>Recently there is one situation in SSRS , Where I am not able to figure it out correct logic for my requirement ,can someone please help me out what is the problem in my logic.</p>
  
  <p>I am trying to pass the parameter value into SSRS dataset query. Please refer the query below. When I am trying to execute the query manually it runs but when I pass parameter in it, not providing me the desired output please refer the screenshot where I executed the query in SSMS.</p>
  
  <p>DataSet Query</p>
  
  <hr>
  
  <pre><code>Select * from(
  SELECT     @Defaulter_Type AS Priority_Count, Priority
  FROM         Quality_Portal_Data_Fact_Graph)  temp
  </code></pre>
  
  <hr>
  
  <p>SQL Query</p>
  
  <hr>
  
  <pre><code>SELECT [NEW_PID_2],[Priority_1] 
    FROM [OneWindowPRD].[dbo].[Quality_Portal_Data_Fact_Graph]
  </code></pre>
  
  <hr>
  
  <p>Although, I figure it out one thing that when I am trying to pass parameter in it. It is passing the value with single cort because of which it is showing data is below mentioned form.</p>
  
  <p><a href="https://i.stack.imgur.com/1thK1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1thK1.png" alt="output of the query when I pass parameter"></a></p>
  
  <p>Can someone please suggest What will I do to remove these single cort.
  Please suggest any other method or logic to select the column of the query which is given by user</p>
  
  <p>I already tried SUBSTRING its not working. Please refer the screenshot </p>
  
  <p>SELECT     QUOTENAME(SUBSTRING(@Defaulter_Type, 2, LEN(@Defaulter_Type) - 2)) AS Count_Priority
  FROM         Quality_Portal_Data_Fact_Graph</p>
  
  <p><a href="https://i.stack.imgur.com/gsTkZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gsTkZ.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/PY5V8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PY5V8.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/cokfy.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cokfy.png" alt="enter image description here"></a></p>
  
  <p>The parameter I am trying to pass in the query is the column_name which is passed by user, it is single value column. Please refer screenshot is someone have any suggestion or other approach</p>