Pull the Last invoice for each invoice listed

bconner

Registered User.
Local time
Today, 07:18
Joined
Dec 22, 2008
Messages
183
I have a table for which I would like to pull the last invoice for each invoice listed. I have tried to use the Max() and the Last() but because the Post Date can be the same it still pulls multiple. I am trying to get the last instance of each invoice.

Below is a table that gives a visual of what I am trying to do.

INV #CURRENT FSCPAYCODEPOST DATEGROUPINV BALANCELOCATIONCHARGE27112910702/10/20094240SEBIP24028189610702/10/20094281.48FRIOIL281.482839951702/26/2009430DENOP480283995522702/26/2009430DENOP4802839952522702/26/2009430DENOP4805118641701/30/20094440.07FRIOIL465.57511864522701/30/20094440.07FRIOIL465.575165771701/30/20094231.02FRIOIL237.62516577522701/30/20094231.02FRIOIL237.62
 
Sorry attached is an example..
 

Attachments

  • Example.jpg
    Example.jpg
    103.5 KB · Views: 126
Is the current FCS field sequential? in other words is the highest one the last one? You something in the source data that will identify which line is the last line for that invoice number.
The only other way is to use the Last() method when grouping by invoice number in your query.

David
 

Users who are viewing this thread

Back
Top Bottom