Why does Last function return the second to last instead of the la

W

wigla

I have created 2 reports, in each of which I use the Last function to return
an invoice number from the last record for different clients, but instead of
displaying the last record, I see the second to last record. Why could that
be? I am not a programmer.
 
R

Rick Brandt

wigla said:
I have created 2 reports, in each of which I use the Last function to
return an invoice number from the last record for different clients,
but instead of displaying the last record, I see the second to last
record. Why could that be? I am not a programmer.

Last() and First() don't do what you think they do (at least not reliably).

If your "last" invoice number is actually a true number and is also the
largest number then use Max() instead of Last(). If not, then you will need
another means to determine the last record. Do you record the date and time
the record was created? If not, you could start doing that and then use the
most recent DateTime to find the last record .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top