Hi Team,
I have below data in my database table ( SQL Server 2008)
id | activityid | timestamp |
7991 | C | 2014-01-16 02:15:10.557 |
7890 | A | 2014-01-15 23:09:09.557 |
6789 | F | 2014-01-15 17:09:09.557 |
5678 | B | 2014-01-13 09:56:16.647 |
4567 | C | 2014-01-12 07:39:17.647 |
3568 | B | 2014-01-11 23:12:17.647 |
3456 | F | 2014-01-11 21:29:17.647 |
2345 | X | 2014-01-10 20:56:44.403 |
2299 | A | 2014-01-10 19:00:44.403 |
2245 | B | 2014-01-10 18:20:44.403 |
2121 | C | 2014-01-10 17:10:44.403 |
1234 | F | 2014-01-10 16:46:44.403 |
the activity id 'F' is a failed event.
My requirement is to show failed event and the immidiate event after the failed event.
Output:
id | activityid | timestamp |
7890 | A | 2014-01-15 23:09:09.557 |
6789 | F | 2014-01-15 17:09:09.557 |
3568 | B | 2014-01-11 23:12:17.647 |
3456 | F | 2014-01-11 21:29:17.647 |
2121 | C | 2014-01-10 17:10:44.403 |
1234 | F | 2014-01-10 16:46:44.403 |
Appriciate any help.
Regards
Ram C