Maybe I'm missing something. Sounds like a match for a temporary table. Retrieve the data, massage the keys, create a temporary table using the new keys. Then you can use all the usual query magic to process the data. -- Collins Richey If you fill your heart with regrets of yesterday and the worries of tomorrow, you have no today to be thankful for.