Finding the largest value among three columns

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.
 
D

Duane Hookom

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top