I need assistance with a formula?

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
Formula needed to indicate a date.

DW 1 is billed on xx/xx/xxxx.
If this date is billed on or after xx/01/xxxx and on or before xx/15/xxxx, return date of xx/10/xxxx of next month.

OR
DW 1 is billed on xx/xx/xxxx.
If this date is billed on or after xx/16/xxxx and on or before xx/31/xxxx, return date of xx/25/xxxx of next month.
Photo of Lynne8817

Lynne8817

  • 580 Points 500 badge 2x thumb

Posted 3 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
Try this for a due date calculation

var date BillingDate = [my field with the Billing Date];

var date SameDayNextMonth = (AdjustMonth($BillingDate,1);


If(Day($BillingDate) <= 15, Date(Year($SameDayNextMonth), Month($SameDayNextMonth),10),

                                           Date(Year($SameDayNextMonth), Month($SameDayNextMonth),25))

,  
Photo of Lynne8817

Lynne8817

  • 580 Points 500 badge 2x thumb
Thank you.  Missing a closing parentheses after:
 (AdjustMonth($BillingDate,1);

Once this was fixed, appears to work.  
 (AdjustMonth($BillingDate,1));

thank you
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,310 Points 50k badge 2x thumb
OK, great.  Actually I should have written it as
var date SameDayNextMonth = AdjustMonth($BillingDate,1);