That doesn't work. I only posted a subset of the data - the data for one ID. The real table has over 100,000 rows for 22,000 different IDs. And there may be multiple entries for each status as in the example below where there ar 2 Cs for the second O. I need to transform the original table into a second table.
Original Table looks like
ID Status UpdateDate
1 O 2008-03-01 00:00:00
1 C 2008-03-03 00:00:00
...
User Profile
Collapse
-
Help finding 'pairs' of rows
I have a table with ID, Status and Date. The status is either Open or Close. For each ID there are multiple records. And there can be multiple entries with the same status but different times. I have to calculate the amount of time that the ID is in an open state. In the example below I have to match row 1 with row 2 and
and row 3 with row 5. In other words, I want the min of the open and the max of the closed that is less than the next...
No activity results to display
Show More
Leave a comment: