How to calculate age?

  • jskus
    Asked on September 20, 2015 at 12:00 AM

    in your forum when i put up date of birth age automatically not showing what is the process for this action kindly tell me?

  • Amber
    Replied on September 20, 2015 at 6:39 AM

    Would this be of any help?

  • Ashwin JotForm Support
    Replied on September 21, 2015 at 1:04 AM

    Hello jskus,

    Unfortunately, we do not have any widgets to calculate Age but with a little workaround it is possible to achieve your requirement.

    You can take advantage of our "Form Calculation" widget to calculate the age. Here are the steps you should follow:

    #1. Add a date time field in your form and set the default date as today's date.

    #2. Add another date time field where user can select date of birth.

    #3. Add "Form Calculation" widget in form and set the formula to calculate the age. Please check the screenshot below: 

    How to calculate age? Image 1 Screenshot 20

     

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • jskus
    Replied on September 21, 2015 at 2:59 AM

    hello

       its working perfect but result of calculation is showing like 24.5, 26.7 etc how it will show in full figure like 24, 25 etc faction figure will not showing after calculation , kindly tell us.

  • Ashwin JotForm Support
    Replied on September 21, 2015 at 7:14 AM

    Hello jskus,

    You will have to edit the "Form Calculation" widget and set the "Decimal Places in Numerical Results" property to "0". Please check the screenshot below on steps to make this change in the form calculation widget:

    How to calculate age? Image 1 Screenshot 20

     

    Hope this helps.

    Do get back to us if you have any questions.

    Thank you!

  • veshman
    Replied on October 10, 2015 at 1:46 PM

    I'm having trouble getting the correct Age in years. I've used the formula as shown, but the result I'm getting is not completely accurate. It's off by one year. Oddly, when the DOB month is before the current month, the age is higher, and when the DOB month is after the current month, the age is lower.

     

  • Ashwin JotForm Support
    Replied on October 11, 2015 at 6:26 AM

    Hello veshman,

    I have moved your question to a new thread and you will be answered here:  http://www.jotform.com/answers/678341020 

    Thank you!

  • Ashwin JotForm Support
    Replied on October 12, 2015 at 7:14 AM

    Hello Randy,

    Thank you for your response here. 

    One of my colleague have also explained this in the other thread. The reason you are not able to open that thread because it is a private thread. 

    Thank you!

  • Ashwin JotForm Support
    Replied on October 12, 2015 at 12:19 PM

    Hello drpatel,

    I am glad to know that the workaround shared in the other thread worked for you.

    Do get back to us if you have any questions.

    Thank you!