1 Reply Latest reply on Jan 28, 2013 12:33 AM by Sorbsbuster

    Calculation of expiry dates

    JacquesSmith

      Title

      Calculation of expiry dates

      Post

           Hi, Noob here,

            

           I have searched the forums and tried to calculate and display the correct infromation that i want but i just dont get the correct information i need.

            

           I have a simple database layout with the following fields

           Licensse_issue_date (Date field)

           License_exp_date (Date field)

           months_until_exp (Text field)

            

           I want to calculate how many months are left before a drivers license expires. Drivers Licenses are valid for 5 years (260 months) and display the ammount of months left before expiring

           Example:

           John has a Drivers License with Issue date: 2010/04/13 and expiry date: 2015/04/13. How many months does john have before his drivers license expires?

           Also i would like to see if i can a notification when - if license is 90 days from expiry date "due to expire" and - if license has passed the expiry date "expired" to the calculation above.

            

           Any helpfull information would be appreciated.

            

        • 1. Re: Calculation of expiry dates
          Sorbsbuster

               "How many months does john have before his drivers license expires?"

               Try:

               months_until_exp (an unstored calculation field, with result type 'Number') = Round ( ( Licence_exp_date - Get ( CurrentDate ) ) / 30.5 ; 0 )

               "Also i would like to see if i can a notification when - if license is 90 days from expiry date"

               For the other two cases, try an unstroed calculation set to type text:

               Case (
               Licence_exp_date - Get ( CurrentDate ) < 90 ; "Less than 3 months to go!" ;
               Licence_exp_date - Get ( CurrentDate ) < 0 ; "Licence expired!" ;
               ""
               )