in the sample data each role only has one userid associated with it. however the problem gets larger as more userid's are associated with each role as the min and max would be by role. so you could see the first and last time each role did something.
if you look at blocks 1, 6, and 8 in the original data, your query would pull the min from block 1 and the max from block 8 completely missing block 6. we need a way to differentiate between blocks 1, 6, and 8 for your query to display the data how the OP wants.
For faster help in answering any problems Please read
How to post data/code on a forum to get the best help - Jeff Moden[/url] for the best way to ask your question.
For performance Issues see how we like them posted here: How to Post Performance Problems - Gail Shaw[/url]
Need to Split some strings? Jeff Moden's DelimitedSplit8K[/url]
Jeff Moden's Cross tab and Pivots Part 1[/url]
Jeff Moden's Cross tab and Pivots Part 2[/url]