Hi John
Thank you for replying
The trnDate column is datetime, and there are never any NULL values.
I tried again, leaving the code as is for reference, and, wonder of wonders, it seems to have worked now. To clarify, the code that took forever is now working in a flash, with NO changes made...