If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Last functions in Total Row
The way I understand these functions, they will return
the last value entered chronologically from a group of records. So if I have a autonumber field in this table, that field should reveal the chronological order in which the records were added. I have a table called Payments with a following sample: PaymentID,ClientID,DateRec,AmtRec 1,1, ,$504 2,1,4/5/04,$50 3,2,3/2/02,$352 4,3,2/3/99,$78 5,2, ,$913 If I create a query grouped by ClientID and the Last total on DateRec and AmtRec, it gives inconsistent results. For example, from the above data, it might return: ClientID,LastOfDateRec,LastOfAmtRec 1,4/5/04,$50 2,3/2/02,$352 3,2/3/99,$78 For some reason, it doesn't always give the last value. Does anyone know why this could be or another way to get the most recently added record value? |
#2
|
|||
|
|||
Last functions in Total Row
Actually, the Last functions are pretty useless. Try using Min or Max
instead. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jordan" wrote in message ... The way I understand these functions, they will return the last value entered chronologically from a group of records. So if I have a autonumber field in this table, that field should reveal the chronological order in which the records were added. I have a table called Payments with a following sample: PaymentID,ClientID,DateRec,AmtRec 1,1, ,$504 2,1,4/5/04,$50 3,2,3/2/02,$352 4,3,2/3/99,$78 5,2, ,$913 If I create a query grouped by ClientID and the Last total on DateRec and AmtRec, it gives inconsistent results. For example, from the above data, it might return: ClientID,LastOfDateRec,LastOfAmtRec 1,4/5/04,$50 2,3/2/02,$352 3,2/3/99,$78 For some reason, it doesn't always give the last value. Does anyone know why this could be or another way to get the most recently added record value? |
#3
|
|||
|
|||
Last functions in Total Row
Are they unreliable? What's the deal with them? Using a
payments table like the one I sampled here, how else could I query the latest payment made by a client? The Min/Max functions don't work for that. Thanks. -----Original Message----- Actually, the Last functions are pretty useless. Try using Min or Max instead. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jordan" wrote in message ... The way I understand these functions, they will return the last value entered chronologically from a group of records. So if I have a autonumber field in this table, that field should reveal the chronological order in which the records were added. I have a table called Payments with a following sample: PaymentID,ClientID,DateRec,AmtRec 1,1, ,$504 2,1,4/5/04,$50 3,2,3/2/02,$352 4,3,2/3/99,$78 5,2, ,$913 If I create a query grouped by ClientID and the Last total on DateRec and AmtRec, it gives inconsistent results. For example, from the above data, it might return: ClientID,LastOfDateRec,LastOfAmtRec 1,4/5/04,$50 2,3/2/02,$352 3,2/3/99,$78 For some reason, it doesn't always give the last value. Does anyone know why this could be or another way to get the most recently added record value? . |
#4
|
|||
|
|||
Last functions in Total Row
On Thu, 27 May 2004 15:37:36 -0700,
wrote: Are they unreliable? Very. What's the deal with them? They return the last record IN DISK STORAGE ORDER. Since Access will store records wherever on the disk there is room (which is *frequently* but not *reliably*) at the end of the table, Last() will often - BUT NOT RELIABLY - give you the most-recently entered record. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public |
#5
|
|||
|
|||
Last functions in Total Row
Thanks for that explanation. Is there any other way that
I could query the most recent record for a payment a client has made from a table of payments? -----Original Message----- On Thu, 27 May 2004 15:37:36 -0700, wrote: Are they unreliable? Very. What's the deal with them? They return the last record IN DISK STORAGE ORDER. Since Access will store records wherever on the disk there is room (which is *frequently* but not *reliably*) at the end of the table, Last() will often - BUT NOT RELIABLY - give you the most-recently entered record. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public . |
#6
|
|||
|
|||
Last functions in Total Row
What's wrong with using Max, as I suggested in my first post?
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Jordan" wrote in message ... Thanks for that explanation. Is there any other way that I could query the most recent record for a payment a client has made from a table of payments? -----Original Message----- On Thu, 27 May 2004 15:37:36 -0700, wrote: Are they unreliable? Very. What's the deal with them? They return the last record IN DISK STORAGE ORDER. Since Access will store records wherever on the disk there is room (which is *frequently* but not *reliably*) at the end of the table, Last() will often - BUT NOT RELIABLY - give you the most-recently entered record. John W. Vinson[MVP] Come for live chats every Tuesday and Thursday http://go.compuserve.com/msdevapps?loc=us&access=public . |
Thread Tools | |
Display Modes | |
|
|