Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Pivot a table on start and end times

$
0
0

I have a table that has a start and end datetime for a certain event. I am trying to find a way to pivot it out so that every hour that this event occurs has it's own row.

 

Below is an example of what I'm trying to do. I want to go from the first table to the second table. Does anyone know a good way to do this? 

 

IDstartend
18/30/2012 6:158/30/2012 8:27
24/4/2012 8:254/4/2012 14:47
310/4/2010 10:1010/4/2010 10:11
   
   
ID Hour 
18/30/2016 6 
18/30/2016 7 
18/30/2016 8 
24/4/2012  8 
24/4/2012 9 
24/4/2012 10 
24/4/2012 11 
24/4/2012 12 
24/4/2012 13 
24/4/2012  14 
310/4/2010  10 

 

Thanks!!


Viewing all articles
Browse latest Browse all 4999

Trending Articles