C chrislabs New member Local time Today, 12:58 Joined Mar 3, 2007 Messages 7 Mar 12, 2007 #1 I know that the Max functions get the highest value but is there a way to get the second or thrid highest value??
I know that the Max functions get the highest value but is there a way to get the second or thrid highest value??
L llkhoutx Registered User. Local time Today, 11:58 Joined Feb 26, 2001 Messages 4,018 Mar 12, 2007 #2 Run successive queries saveing the maximun. In each successive query filter out the previous found maximum. Alternatively - Cycle through your records one by one using DAO/ADO and save the highest three values.
Run successive queries saveing the maximun. In each successive query filter out the previous found maximum. Alternatively - Cycle through your records one by one using DAO/ADO and save the highest three values.
Dennisk AWF VIP Local time Today, 17:58 Joined Jul 22, 2004 Messages 1,649 Mar 12, 2007 #3 Even Easier use a query and sort descending and specify TOP 3 ie SELECT TOP 3 [MH Patient].MHID FROM [MH Patient] ORDER BY [MH Patient].MHID DESC
Even Easier use a query and sort descending and specify TOP 3 ie SELECT TOP 3 [MH Patient].MHID FROM [MH Patient] ORDER BY [MH Patient].MHID DESC
L llkhoutx Registered User. Local time Today, 11:58 Joined Feb 26, 2001 Messages 4,018 Mar 12, 2007 #4 Good post Dennisk.
O Oksana New member Local time Today, 09:58 Joined Mar 10, 2007 Messages 2 Mar 12, 2007 #5 "Second" maximum To find second highest value: Code: SELECT Max([Number]) AS SecondMax FROM SomeTable WHERE [Number]<DMax("Number","SomeTable");
"Second" maximum To find second highest value: Code: SELECT Max([Number]) AS SecondMax FROM SomeTable WHERE [Number]<DMax("Number","SomeTable");