eamonn.byrne (9/17/2012) Jeff Moden (9/16/2012) eamonn.byrne (9/14/2012)
Yep that definately works. It took you 5 seconds to fix what had me scratching my head for a couple of hours.
Before you use it, Joe is right.
1. What is the key here? Is it just EmgID or is it EmgID and Reference together.
2. Regardless of what the answer to 1 is, is there anything special you want done for an EmgID with multiple Reference values?
Thanks for the further replies gus and apologies if I wasn't clear. Yes the key is the combined EMGID and Reference fields. Lynn was on the money though and I was able to work out the rest of what I needed from what she provided.
Glad I could help. One small thing, I am not a she, I am a he.
For better assistance in answering your questions, click hereFor tips to get better help with Performance Problems, click hereFor Running Totals and its variations, click here
or when working with partitioned tablesFor more about Tally Tables, click hereFor more about Cross Tabs and Pivots, click here
and hereManaging Transaction Logs
SQL Musings from the Desert Fountain Valley SQL
(My Mirror Blog)