Calculating months between dates

  • 0
  • 1
  • Question
  • Updated 10 months ago
  • Answered
I need to return a string if a date is falling in next 6, 12, 24 month.  I tried to use the following to construct first line but does not look like I have got this right. 

If(AdjustMonth([Lease Expiry],6)< 6, "Next 6 Months")

Could someone help? 
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,142 Points 3k badge 2x thumb

Posted 10 months ago

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

QuickBaseCoach App Dev./Training, Champion

  • 52,928 Points 50k badge 2x thumb
Try this

If(
isnull([lease expiry], "Missing Lease Expiry",
AdjustMonth([Lease Expiry],0) <= Today(), "Expired",
AdjustMonth([Lease Expiry],-6) <= Today(), "Next 6 Months",
AdjustMonth([Lease Expiry],-12) <= Today(), "Next 12 months",
AdjustMonth([Lease Expiry], -24) <= Today(), "Next 24 Months", "More that 24 months)
)
Photo of Arshad Khwaja

Arshad Khwaja

  • 3,142 Points 3k badge 2x thumb
Mark

As always learning from you. Many thanks.