Finding the largest value among three columns

  • Thread starter Thread starter Mario
  • Start date Start date
M

Mario

Let's say I have a table like this

Name |Maths |Science |English
-------------------------------
David |45 |65 |43
Mathew |78 |87 |67
Tom |56 |73 |74
Jeena |34 |91 |98

I want to find the maximum mark scored by a student. That
is in this case.

David - 65
Mathew - 87 and so on.,

I have tried MAX, DMAX, MAXD and LARGE Fucntions. They
didnt work.

I used the querry

SELECT Students_Marks.*, MAX(Math,Science,English) AS
MAX_MARK
FROM Students_Marks;

I keep getting the error "Wrong number of arguments used
with function in querry expression 'MAX
(Math,Science,English)'


Please Help.
 
The problem is that you have data values as field names. Check
www.RogersAccessLibrary.com for the following sample files:

FlatFileDemo2k.mdb (60 KB) ( beginner ) Access 2000
This example illustrates some of the difficulties inherent in bad
(non-normalized) database design and how they can be corrected. It is not a
formal tutorial on Normalization, rather it is a series of examples which
allow you to demonstrate the kind of trouble that a non-normalized can
produce.

NormalizeDenormalize2k.mdb (37 KB) ( intermediate ) Access 2000 DAO
It illustrates how to take a table which has fields like Value1, Value2,
Value3,... and writes them into a table which has one field (Value) with
each of the values in a new record
 
Back
Top