This question is in continuation to Merging every two rows of data in a column in SQL Server
My eventtable structure..
Id UserId EventId EventDateTime
1 1 A 18-06-2013 10:36
2 1 B 18-06-2013 10:40
3 1 C 18-06-2013 10:46
4 1 D 18-06-2013 10:50
5 1 A 18-06-2013 13:36
From the earlier question I got data in the following format..
UserId EventStart EventEnd
1 A B
1 B C
Now I would like to get the count of Unique 'EventStart' and 'EventEnd' and filter them by UserId and Date/s
The Report format is
EventStart EventEnd Count
A B 5
B C 3
I know that i could use the data from the previous Question query and store it in a table and try as suggested here
But it would be great if I could get the data straight from the 'eventtable' to the report format with the 'UserId' and 'Date' filters
Any help is sincerely appreciated..
Thanks..