yes, the previous suggestion might be just fine, but SQL seems better for several reasons
- the primary key could be integer 64-bits which is not handled in the other example - all records+order by creates 2 current selections in the other example, none in this one - clean code, the intent is apparent in both cases the assumption is that no other process is actively adding records (no need to code explicitly, you are running maintenance and it is a one shot operation) > I would not do this. I would > begin sql > Select MAX ([table].[field]) > from > [table] > into > :$max > end sql ********************************************************************** 4D Internet Users Group (4D iNUG) New Forum: https://discuss.4D.com Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

