title: how to use dynamic pivot for making Date in a month appear as columns - Month is explicitly mentioned
body: <pre><code>DECLARE @month AS INT = 5
  DECLARE @Year AS INT = 2016
  
  ;WITH N(N)AS 
  (SELECT 1 FROM(VALUES(1),(1),(1),(1),(1),(1))M(N)),
  tally(N)AS(SELECT ROW_NUMBER()OVER(ORDER BY N.N)FROM N,N a)
  SELECT ROW_NUMBER() OVER(ORDER BY N) AS SLNO ,N day,datefromparts(@year,@month,N) date INTO #CTETEST FROM tally
  WHERE N &lt;= day(EOMONTH(datefromparts(@year,@month,1)))
  </code></pre>
  
  <p>I want to make the day out as columns. Can somebody give advise?</p>