Minimum of two or more fields

N

Natasha

Hi there,

I have a query in that has one row in each column, and I
need to find the minimum result from two or more columns
in another query. Does anyone know how to do this? I've
considered trying to get all the required fields under the
one column but it isn't viable.

Thanks,
Natasha.
 
M

Michel Walsh

Hi,


That is the way to proceed, to have the values under the same column.
Note that this arrangement is the right way for computation, but probably
very wrong for presentation, but presentation are done through FORMs, not
through TABLEs. Tables should be designed to make the work easy, Forms
should be designed to make the consultation easy. You are not in Excel to be
"canned" with the data disposition in a grid, turn that to your advantage.
Anyhow, if you need the max between f1 and f2, someone can do:

iif( nz(f1, f2) > nz(f2, f1), nz(f1, f2), nz(f2, f1) )


if you do not have to deal with Null, then just:

iif ( f1>f2, f1, f2)



Hoping it may help,
Vanderghast, Access MVP
 

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