Click here to Skip to main content
15,889,834 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
DateCodeDate
Testing1XYZ2018-05-21
Testing2XYZ2018-05-21
Testing3XYZ2018-05-22
Testing4XYZ2018-05-22
Testing5XYZ2018-05-22
Testing6XYZ2018-05-23
Testing7XYZ2018-05-23
Testing8XYZ2018-05-24
Testing9XYZ2018-05-24
Testing10XYZ2018-05-24
Testing11XYZ2018-05-25
Testing12XYZ2018-05-25
Testing13XYZ2018-05-26
Testing14XYZ2018-05-26
Testing15XYZ2018-05-27
Testing16XYZ2018-05-27
Testing17XYZ2018-05-27

i need the data like below


2018-05-212018-05-222018-05-232018-05-242018-05-252018-05-262018-05-27
Testing1Testing3Testing6Testing8Testing11Testing13Testing15
Testing2Testing4Testing7Testing9Testing12Testing14Testing16
 Testing5 Testing10  Testing17


What I have tried:

how to achieve this i have tried PIVOT but the columns headers(Date) are not fixed, need to display the 7 date's data from user selected date
please help me thank u
Posted
Updated 1-May-19 6:35am
v3

1 solution

I would still use PIVOT but because you don't know the column headers until run-time you need to program some "dynamic SQL" - See Coding Dynamic SQL Statements[^]
 
Share this answer
 

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