Min of Two Calculated Fields On Form

jneirinckx

Registered User.
Local time
Today, 14:42
Joined
Feb 28, 2004
Messages
133
Good morning,

I'am struggling in finding the Minimum of two calculated fields on my form.

I have two calculated fields in my form frmParticipentInformation "lastworked" which calculates the number of weeks the client has been out of work and "lastattended" which calculates the number of weeks the client has been out of school. What I would like to happen is that it checks these two controls and give the smallest of the two which I can the use to do another calculation based on the Minimum number of these two calculated fields. it seems that it should be simple but I can't get it to work.

Any help you can give would be appreciated.

Thanks

Jerry
 
There doesn't appear to be a MIN in Access that works like Excel's, but you could try an IIf, no?

=IIf([field1]>[field2],[field2],[field1])

I did not test it...
 
Perfect Solution

Dreamboat said:
There doesn't appear to be a MIN in Access that works like Excel's, but you could try an IIf, no?

=IIf([field1]>[field2],[field2],[field1])

I did not test it...

That worked perfect. Bless your heart

Thanks

jerry :)
 
Cool, Jerry.

But any decent Access geek could come along and give you a better, shorter formula. I'm no Access geek at all. :)
 
Hi Jerry and Anne,
I happened to be called Jerry too and therefore call me Jerry2 :o . I also happen to be trying to do the same thing as Jerry1. Being a beginner, sorry for asking, where do you put this Iff formula? In the query design? or the VBA environment for the form? or the property of the textbox in the form? Thks in advance.

Jerry2
 
Iiiiiiiiif the form is based on a query, put it in the query. If it's based on a table, put it on the form's textbox.

I'm no coder, soo... :)
 

Users who are viewing this thread

Back
Top Bottom