By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
461,985 Members | 476 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 461,985 IT Pros & Developers. It's quick & easy.

General "Last of" vs "Max of" question

P: 17
When creating a query in Access (assumption is the data has a unique ID which is numerical...new records, autonumber) how reliable is the "Last of" grouping function vs the "Max of" the ID, and then linking that max of with a record in another query. I've had issues in the past where the "last" record, isn't necessarily the last record entered.

In my case, I'm updating product pricing, so I always want to pull the most recently entered pricing into the query. What drives the "last" of, because it seems much easier to create on query with the last of, than two with a max od and then match.

Let me know if I need to clarfiy...
Sep 19 '07 #1
Share this Question
Share on Google+
3 Replies

Scott Price
Expert 100+
P: 1,384
When creating a query in Access (assumption is the data has a unique ID which is numerical...new records, autonumber) how reliable is the "Last of" grouping function vs the "Max of" the ID, and then linking that max of with a record in another query. I've had issues in the past where the "last" record, isn't necessarily the last record entered.

In my case, I'm updating product pricing, so I always want to pull the most recently entered pricing into the query. What drives the "last" of, because it seems much easier to create on query with the last of, than two with a max od and then match.

Let me know if I need to clarfiy...

Max() is preferable since Last() only looks at the last record in the recordset (table, query) This is affected by sort order, so if you are sorting alphabetically and enter a new 'latest' record of Apple, it will not be the 'last' record.

Regards,
Scott
Sep 19 '07 #2

P: 17
Thank you for your help. I didn't know last takes sorting order into account.
Sep 21 '07 #3

Scott Price
Expert 100+
P: 1,384
Thank you for your help. I didn't know last takes sorting order into account.
You're quite welcome! More information is available in the help files on these two functions. The simplest way is to go into VBA editor window, type the keyword into the Immediate window and press F1.

Regards,
Scott
Sep 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.