0

While creating PIVOT table in Sql Server i need to mention the column in hard coded manner but now i have to write down all the columns. Now from my code you can see i can't predict what a month user might choose and i want to show that months all dates.

pivot
(
  sum(column1)
  for Date in ( 
  [04-18-2014], [04-19-2014]
)

Here i have to mention that [04-18-2014], [04-19-2014] are the column names that i have to use. how can i extract all the columns whatever present in Date column like a wild card character or something else which can help me to solve this problem.

Bharadwaj
  • 2,535
  • 1
  • 22
  • 35
Mohit
  • 2,189
  • 4
  • 22
  • 40

0 Answers0