Calculated Expiry Date with multiple results

Modified on Fri, 04 Mar 2022 at 12:31 PM

If you want to create an expiry date that changes depending on a Date of Birth to various values do the following..


1. Add a calculated field called Expiry Date


Menu Button > Modify Database > Add Field > Calculated Field > Name it 'Expiry Date'. If you have the default expiry date field in the database you will need to remove it.


2. Add this script to the default value within the Expiry Date field..


Menu Button > Modify Database > ModifyField >Click Expiry Date Field and Edit table on left in default value as below using this script..


Iif(Age(Date Of Birth) < 7,  AddYears(Date Of Birth, 7),  Iif(Age(Date Of Birth) < 18,  AddYears(Now, 5 ), AddYears(Now, 10) ) )


Click OK > Save to save changes



3. Add a field called Date Of Birth which needs to be populated with Date Of Birth data..


Menu Button > Modify Database > Add Field > Add Date Of Birth Field.


This example will do the following


If they are under 7 years old, it should expire on their 7th Birthday, if they are under 18 it should expire 5 years from printing and otherwise, it should expire 10 years from printing.  




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article