Click here to Skip to main content
15,883,831 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have 5 columns
equpname
pm_Date
ActDate
doneby
reviewby


by using this
http://sqlhints.com/2014/03/08/how-to-get-quarterly-data-in-sql-server/[^]

I have generated some date but how to get date in below format please help


equpnameq1q2
pmdateact datedone byreviewed bypmdateact datedone byreviewed by
Posted
Updated 17-Oct-15 22:56pm
v3
Comments
Maciej Los 18-Oct-15 7:07am    
To be able to help you, we need to get input data.
Jörgen Andersson 18-Oct-15 7:15am    
What database and version thereof are you using?

1 solution

I'd strongly recommend to read this: Pivot two or more columns in SQL Server 2005[^]

The author of related article states that you're able to pivot more then one column, but you have to add extra info into pivoted column.
In your case it would be something like this:
equpname q1_pm_Date q1_ActDate q1_doneby q1_reviewby q2_pm_Date q2_ActDate q2_doneby q2_reviewby


Got it?

To achieve what you want to achieve, you need to use reporting tool, which provides functionality to display multiple headers.

More you'll find at CP Knowledge Base[^] site.
 
Share this answer
 
Comments
[no name] 18-Oct-15 11:52am    
+5
Maciej Los 18-Oct-15 11:57am    
Thank you, Bruno.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900