I know Access only has limited functions in this area, so I hoping someone has already created some code for the following (if not I will have a go myself). The function I need is equivalent to the Large function in Excel (LARGE(array,k) - Returns the k-th largest value in a data set). A search of the forum and one or two websites has not provided an answer.
For my purposes, I need to determine the maximum and the next highest number for a group, then add them together and divide them by 1000. Obviously, selecting the maximum is not a problem, but determining the next highest is more problematic. In the absence of any existing code, my thoughts on code required would to use a loop to determine the 2nd highest value for a group.
Any suggestions would be appreciated.
Thanks & Regards