Best way to add months (duration) to a date formula?

  • 1
  • 1
  • Question
  • Updated 10 months ago
  • Answered

Has anyone been able to establish the most elegant way of adding the duration in months to a date formula?

I know it's not straightforward because there are lots of variables in days in the month, and leap years etc.  However, it would be great if someone has gone through this and was prepared to share their working?

[Date Agrmnt Signed] + [Agreement Duration (Months)]

Thanks.

Photo of Donnie

Donnie

  • 0 Points

Posted 3 years ago

  • 1
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,320 Points 50k badge 2x thumb
Yes. There is an elegant way

[Date Agrmnt Signed] + Months([Agreement Duration (Months)])

This presumes that the [Agreement Duration (Months)] field is numeric.
Photo of Donnie

Donnie

  • 0 Points
Unfortunately, that doesn't seem to be recognised, Mark.

Formula error -- Unknown function
The function name Months(number) is unknown.
Photo of Donnie

Donnie

  • 0 Points
Just to let you know, I've figured it out

AdjustMonth([Date Agrmnt Signed], [Agreement Duration (Months)])
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,320 Points 50k badge 2x thumb
Oh sorry. My mistake. The syntax is

AdjustMonth([Start Date], [number of months])
Photo of Nicole Cordeiro

Nicole Cordeiro

  • 90 Points 75 badge 2x thumb
I'm having an issue as well, even using the formula above. I'm sure I'm doing something wrong. I have a date field called "hire date". I need another field to automatically add 6 months to the hire date and display it. This is the employees probation period. I want quickbase to automatically give me that date based on the "hire date". Help :(
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,320 Points 50k badge 2x thumb
AdjustMonth([Hire Date], 6)
Photo of Nicole

Nicole

  • 30 Points
Thank you so much! I figured out what I did wrong; the field type was numeric and not a date. Thank you!!