Thanks for the help, Kevin. I would rather just use cursors, but it doesn't look like I can insert records into a cursor. I also tried getting the rank in the sql statement, but the table is so large that the sql statement takes forever to run. How can I make sure that the temp table name is unique?
Randy Belcher
AFG Industries, Inc.