Max Value

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])
 
A

Allen Browne

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
 
M

Mike C

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])
 

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

Similar Threads


Top