Using Yearsold in the benefit rate table

SUGGESTED

I know how to use yearsold in the benefit rate table when calculating an employees age based on the system date.  I want to use the same but have it calculate the employee's age at a certain date.  This employers benefits renew once a year and the age of the employee on that specific date determines the premium until the beginning of the next renewal year.  In this case it is Septermber 1st of each year.  Meaning if an employee has a birthday after Sept 1, then the premium amount moves to next amount in our table.  

I have tried yearsold({Pe.p_birth},{09/01/2021}) but that doesn't seem to work.  Any thoughts or suggestions?

Thanks

  • 0

    I think I have it worked out - IIF((MONTH(Pe.p_birth)<9),Yearsold()-1,Yearsold())                                                                                                                                                                                                            

  • 0
    SUGGESTED

    Hi Howard,

    It gets a little tricky. Try this formula.  

    IIF(CTOD("09/01/"+STR(YEAR(DATE())))<=DATE(),INT((CTOD("09/01/"+STR(YEAR(DATE())))-TtoD(PE.P_BIRTH))/365.25), INT((CTOD("09/01/"+STR(YEAR(DATE())))-TtoD(PE.P_BIRTH))/365.25)-1)