SELECT Last(Invoices.InvoiceID) AS LastOfInvoiceID
ORDER BY Last(Invoices.InvoiceID);
I have this code that updates into a table. What this is meant to do is select the last invoice entered
into the invoice table and populate it into another table. This works 95% of the time
But then, for no reason I can see, it gets stuck and populates the table with the same number for new invoices
entered. And then, for no reason I can see, clears itself and starts populate the table the last invoice number.
As it should. If I compact and Repair this also clears the problem.
We are using terminal services and have users logging on from a variety of geographical locations.
Thanks for your reply to this. I never really found out the reason why it was doing this
however I have found a soultion by getting the number by a different route. So for completeness
I have put the coded solution below.