Choosing max number from 2 fields

creeping

Registered User.
Local time
Tomorrow, 07:44
Joined
Feb 9, 2003
Messages
20
Hi,

How do you use the MAX function on 2 fields in SQL to then produce the result a new field.

i.e

12, 24

would go to:

12, 24, 24 << this is the max of fields 1 & 2

Cheers
 
Put this in the Field: cell of a column in the query grid:-

MaxNum: IIf([Field1]>[Field2],[Field1],[Field2])


If the fields contain null values, use the Nz() function:-

MaxNum: IIf(Nz([Field1])>Nz([Field2]),[Field1],[Field2])
 
thanks heaps
 

Users who are viewing this thread

Back
Top Bottom