>I beleive without temporary PK you will get in trouble -
>here if on the same day to bills happen to be in existance.
>
Building analogue of row_number() in VFP it's quite tricky (SQL 2000 also). It can be done with subquery, but I don't want to post this solution. If we have such requirement, build the needed output using scan/endscan logic in VFP.
If it's not broken, fix it until it is.
My Blog