1 Reply Latest reply on Feb 9, 2009 9:37 PM by davidhead

    Automatic Contract End Calculation

    Diegoale2000

      Title

      Automatic Contract End Calculation

      Post

      Hello everyone,

       

      I'm working on a small database to manage my Monthly Newspaper/Publication.

       

      On the Client Management section of the database, I have something like this:

       

      Contract Start
      Contract Length

      Contract End

       

       

      Since my publication is monthly, i don't care about what day the contract starts/ends, Just the Month and Year.

       

      I'd like for the Contract End to be automatically generated.

       

      Contract Start is a Date

      Contract Length is a Number (says how many months it's active since the Contract Start)

       

       

      i'd like the contract end be the result of the contract date (month and year) + the length of the contract (In months)

       

      Any idea on how to do this?

        • 1. Re: Automatic Contract End Calculation
          davidhead
            

          You say that you are not really interested in the day that the contract ends. Therefore we could calculate all end dates as the first of the month? If so, Contract End =

           

             Date ( Month(Contract Start) + Contract Length; 1 ; Year(Contract start) )

           

          ...the result is a date. 

           

          If you want the end date to be the last day in the month, use this:

           

             Date ( Month(Contract Start) + Contract Length + 1; 0 ; Year(Contract start) )