A Access macro for comparing the less of 2 values

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Microsoft Access, we need a macro for comparing the lesser value of 2
values in separate fields and for the results to populate in one field.
 
Joanne said:
In Microsoft Access, we need a macro for comparing the lesser value of 2
values in separate fields and for the results to populate in one field.

As a general rule, you should never store anything that is the result of a
calculation, but make the calculation at run-time in a query. In this case
you could probably use an in-line if statement as a calculated field:

Iif([Field1] < [Field2], [Field1], [Field2])

You'd probably need to handle nulls too.

HTH - Keith.
www.keithwilby.com
 
Back
Top