• Glad it helped, Nikki, but please take to heart the warning that SQL tables have no sequence unless you can ORDER BY on a column. If you are importing data from files, and there is some logical sequence there, preserve it. Create a rowID counter for them in the program that pulls them from the files. Here we had a date sequence to work with, but what if there were multiple rows with the same date, or an S and a B got in the wrong order? The code I posted could have given you the wrong answer. I know you're moving on to other problems now, but the absence of a natural sequence is important.

    __________________________________________________

    Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
    Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills