G
Guest
I need to add an expression to a select query that returns the greatest of
several values - like the MAX(a,b,c) function in Excel.
For example, I need to be able to create the "MaxSales" field by saying
MAX(WestSales, EastSales)
Rep WestSales East Sales MaxSales
Smith 100 50 100
Jones 90 200 200
How do I do this in an SQL statement?
(I can't use an iif statement because I need to select from several fields
and calculated values and iif just won't work)
Any help is appreciated.
several values - like the MAX(a,b,c) function in Excel.
For example, I need to be able to create the "MaxSales" field by saying
MAX(WestSales, EastSales)
Rep WestSales East Sales MaxSales
Smith 100 50 100
Jones 90 200 200
How do I do this in an SQL statement?
(I can't use an iif statement because I need to select from several fields
and calculated values and iif just won't work)
Any help is appreciated.