formula in a form

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

Guest

I have a to different textboxes in my form with dates. I want another textbox
to give me years difference between the other two dates. Please help. Thanks
 
I have a to different textboxes in my form with dates. I want another textbox
to give me years difference between the other two dates. Please help. Thanks

As the control source of an unbound control on your form:
=DateDiff("yyyy",[Date1],[Date2])
 
I would assume you want to calculate age?

I'd use something like...


DateDiff("yyyy",[Higherdatefield],[LowerDateField)+(Format([HigherDateField]
,"mmdd")>Format([LowerDateField],"mmdd"))




Hope that helps, Rick B




Dahlman said:
I have a to different textboxes in my form with dates. I want another textbox
to give me years difference between the other two dates. Please help.
Thanks
 
Thank you very much Fredg and Rick B. I had to use both of them because one
was age and another was years of service. I appreciate the help.
 
The same "age" calculation would work for years of service. If you use the
other formula provided, it does not take into account if the date has passed
or not.

Rick B


Dahlman said:
Thank you very much Fredg and Rick B. I had to use both of them because one
was age and another was years of service. I appreciate the help.
Thanks
 

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

Similar Threads


Back
Top