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

  • Thread starter Thread starter wigla
  • Start date Start date
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.
 
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 .
 
Back
Top