J
Java
Hi, I have a table that has a column called ShipDate. I need to have
ShipDate in multiple columns - Date1, Date2, Date3, etc... (not the actual
date as the column).
The cross tab gives me the actual date as column which is not what is
needed.
This is just a sample. I'm not sure why this is needed but it is being
requested of me.
MyTable
CustomerID ProductID Quantity ShipDate
123 T100 5 8/23/2008
123 T100 5 8/24/2008
123 T100 5 8/25/2008
123 T200 10 8/23/2008
123 T200 10 8/24/2008
123 T200 10 8/25/2008
123 T300 15 8/23/2008
123 T300 15 8/24/2008
123 T300 15 8/25/2008
456 T500 5 8/25/2008
456 T500 5 8/26/2008
456 T500 5 8/27/2008
456 T600 10 8/25/2008
456 T600 10 8/26/2008
456 T600 10 8/27/2008
456 T700 15 8/25/2008
456 T700 15 8/26/2008
456 T700 15 8/27/2008
Crosstab
CustomerID ProductID Quantity 8/23/2008 8/24/2008 8/25/2008 8/26/2008 8/27/2008
123 T100 5 8/23/2008 8/24/2008 8/25/2008
123 T200 10 8/23/2008 8/24/2008 8/25/2008
123 T300 15 8/23/2008 8/24/2008 8/25/2008
456 T500 5 8/25/2008 8/26/2008 8/27/2008
456 T600 10 8/25/2008 8/26/2008 8/27/2008
456 T700 15 8/25/2008 8/26/2008 8/27/2008
Need for data to look like this
CustomerID ProductID Quantity Date1 Date2 Date3 Date4 … Date5n
123 T100 5 8/23/2008 8/24/2008 8/25/2008
123 T200 10 8/23/2008 8/24/2008 8/25/2008
123 T300 15 8/23/2008 8/24/2008 8/25/2008
456 T500 5 8/25/2008 8/26/2008 8/27/2008
456 T600 10 8/25/2008 8/26/2008 8/27/2008
456 T700 15 8/25/2008 8/26/2008 8/27/2008
Thanks!
ShipDate in multiple columns - Date1, Date2, Date3, etc... (not the actual
date as the column).
The cross tab gives me the actual date as column which is not what is
needed.
This is just a sample. I'm not sure why this is needed but it is being
requested of me.
MyTable
CustomerID ProductID Quantity ShipDate
123 T100 5 8/23/2008
123 T100 5 8/24/2008
123 T100 5 8/25/2008
123 T200 10 8/23/2008
123 T200 10 8/24/2008
123 T200 10 8/25/2008
123 T300 15 8/23/2008
123 T300 15 8/24/2008
123 T300 15 8/25/2008
456 T500 5 8/25/2008
456 T500 5 8/26/2008
456 T500 5 8/27/2008
456 T600 10 8/25/2008
456 T600 10 8/26/2008
456 T600 10 8/27/2008
456 T700 15 8/25/2008
456 T700 15 8/26/2008
456 T700 15 8/27/2008
Crosstab
CustomerID ProductID Quantity 8/23/2008 8/24/2008 8/25/2008 8/26/2008 8/27/2008
123 T100 5 8/23/2008 8/24/2008 8/25/2008
123 T200 10 8/23/2008 8/24/2008 8/25/2008
123 T300 15 8/23/2008 8/24/2008 8/25/2008
456 T500 5 8/25/2008 8/26/2008 8/27/2008
456 T600 10 8/25/2008 8/26/2008 8/27/2008
456 T700 15 8/25/2008 8/26/2008 8/27/2008
Need for data to look like this
CustomerID ProductID Quantity Date1 Date2 Date3 Date4 … Date5n
123 T100 5 8/23/2008 8/24/2008 8/25/2008
123 T200 10 8/23/2008 8/24/2008 8/25/2008
123 T300 15 8/23/2008 8/24/2008 8/25/2008
456 T500 5 8/25/2008 8/26/2008 8/27/2008
456 T600 10 8/25/2008 8/26/2008 8/27/2008
456 T700 15 8/25/2008 8/26/2008 8/27/2008
Thanks!