Help selecting Max of fields in a record

fpperry

Earnest Dabbler
Local time
Yesterday, 23:43
Joined
Jan 13, 2003
Messages
9
I have a form that enters variable data to a table, 12 fields. I want to access that record and evaluate it for the maximum value in the record. I've tried several approaches but i can't seem to open the table from VB and read the fields of the 1st record. Can someone please assist?
 
You coudl use a UNION query to stackyour values together in a column then run a max against it:

Code:
SELECT tblFindAcrossFields.N1 as FieldToMax
FROM tblFindAcrossFields; UNION
SELECT tblFindAcrossFields.N2
FROM tblFindAcrossFields;UNION
SELECT tblFindAcrossFields.N3
FROM tblFindAcrossFields;UNION
SELECT tblFindAcrossFields.N4
FROM tblFindAcrossFields;UNION 
SELECT tblFindAcrossFields.N5
FROM tblFindAcrossFields;

then run the max query against it:

Code:
SELECT Max(maxqrytest.FieldToMax) AS MaxOfFieldToMax
FROM maxqrytest;
 

Users who are viewing this thread

Back
Top Bottom