I want to take the “Created” time difference between stalled(NewValue) and stalled(OldValue) for the particular ticket_id
Note : This is my first post.I can’t attach the pic due to some restriction.
+-----------+----------+----------+---------------------+
| Ticket_id | OldValue | NewValue | Created |
+-----------+----------+----------+---------------------+
| 20100 | new | wip | 2012-10-01 07:38:18 |
| 20100 | wip | stalled | 2012-10-01 10:12:14 |
| 20100 | stalled | wip | 2012-10-01 22:09:39 |
| 20100 | wip | open | 2012-10-02 01:03:26 |
| 20100 | open | stalled | 2012-10-02 01:03:26 |
| 20100 | stalled | wip | 2012-10-03 06:55:42 |
| 20100 | wip | open | 2012-10-03 19:24:53 |
| 20100 | open | stalled | 2012-10-03 19:24:53 |
| 20100 | stalled | open | 2012-10-04 19:28:48 |
| 20100 | open | resolved | 2012-10-04 21:01:17 |
+-----------+----------+----------+---------------------+
Use something like:
This will show you the difference between the two values (except for the first record). You could add an extra IF or just don’t show the first date.