>Thanks, Boris. Do you think my code for looping through the records is OK?
Sure,
I use such loop when I need it :-)
But instead of TOP 1 I use MIN() :-) and I am not sure which is faster :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.