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
 

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

Back
Top