Max Value

  • Thread starter Thread starter Mike C
  • Start date Start date
M

Mike C

I have a select query that runs off a couple crosstab queries. The crosstab
queries are set up with fixed columns that show Mon, Tue, Wed, Thu, Fri. I
would like to add an expression field that gives me the maximum value from
Mon to Fri. I can't use the Max function because the Max function can only
evaluate 1 field at a time. Does anyone know a way around this or have an
ideas? Below is what I tried to do to get the Max value from Mon through Fri.

Max([Mon],[Tue],[Wed],[Thu],[Fri])
 
In a crosstab query, one field is the Row Heading, one supplies the Column
Headings, and one is the Value.

Select the same field you used for Value again.
This time choose Max in the Total row, and Row Heading in the Crosstab row.
This field will now display the maximum value for the row.

If you really want to do it with a function, see MaxOfList() here:
http://allenbrowne.com/func-09.html
 
Wow, MaxofList rules !!!

Thanks very much.


Allen Browne said:
In a crosstab query, one field is the Row Heading, one supplies the Column
Headings, and one is the Value.

Select the same field you used for Value again.
This time choose Max in the Total row, and Row Heading in the Crosstab row.
This field will now display the maximum value for the row.

If you really want to do it with a function, see MaxOfList() here:
http://allenbrowne.com/func-09.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Mike C said:
I have a select query that runs off a couple crosstab queries. The
crosstab
queries are set up with fixed columns that show Mon, Tue, Wed, Thu, Fri.
I
would like to add an expression field that gives me the maximum value from
Mon to Fri. I can't use the Max function because the Max function can
only
evaluate 1 field at a time. Does anyone know a way around this or have an
ideas? Below is what I tried to do to get the Max value from Mon through
Fri.

Max([Mon],[Tue],[Wed],[Thu],[Fri])
 
Back
Top