Create exprn that returns the highest value of 4 fields in a query

G

Guest

Hi

My query looks like this: [date], [Number], [1st mm taken off], [2nd mm
taken off], [3rd mm taken off], [4th mm taken off], [Exprn1]

I need the [Exprn1] field to return the highest value of all the 'mm taken
off' fields.

Just a note - all the 'mm taken off' fields are calculated fields from a
form...

HELP
Thanks
Fiona.
 
A

Allen Browne

Access is not designed to give this to you easily, because repeating fields
(first, 2nd, 3rd, ...) breaks the most basic rules of data normalization.

You can do it with a very convoluted set of IIf() expressions.
Alternatively, if you are comfortable with writing a VBA function to use in
your query, you can do it like this:
http://allenbrowne.com/func-09.html
 

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

Top