Use a union query to normalize the data.
First Query - Saved as TheUnionQuery
SELECT [Name] as TheName , Points1 as Points
FROM SomeTable
UNION ALL
SELECT [Name], Points2 as Points
FROM SomeTable
UNION ALL
SELECT [Name], Points3 as Points
FROM SomeTable
UNION ALL
SELECT [Name], Points4 as Points
FROM SomeTable
UNION ALL
SELECT [Name], Points5 as Points
FROM SomeTable
UNION ALL
SELECT [Name], Points6 as Points
FROM SomeTable
Second query - uses the first to get the totals. The problem is that if there
are ties for the 4th points then the ties will be included.
SELECT TheName, SUM(Points) as TotalPoints
FROM TheUnionQuery
WHERE Points in
(SELECT TOP 4 Points
FROM TheUnionQuery as TEMP
WHERE Temp.TheName = TheUnionQuery.TheName
ORDER BY Points DESC)
GROUP BY TheName
Another option would be to write a custom VBA function to step through the
values, pick out the highest 4, sum them, and then return the result.
John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I need to calculate total points per individuals using only their best 4 out
of 6 points earned. My table fields are as follows
Name
Points1
Points2
Points3
Points4
Points5
Points6
TotalPoints
Can you help me accomplish this? I know in Excel I could use the small
function and drop the lowest number.