Finding top three values in six fields

bbwolff

Registered User.
Local time
Today, 14:04
Joined
Oct 1, 2013
Messages
116
I'm doing a medical db, where I'm trying to calculate ISS (
Code:
en.wikipedia.org/wiki/Injury_Severity_Score
).

There are 6 values, and i have to sum the largest three (squares to be precise). How can I get three highest values from 6 fields in the same record?


tx
 
Sounds like you have a structure issue.

Those values should probably be held in one field in a related table with another field to indicate the what currently separates them into different fields. Then finding totals on the data is simple.

Otherwise use a Union query as a subquery to combine the fields into one then use TOP 3 in the main query.
 

Users who are viewing this thread

Back
Top Bottom