Error: Incorrect Format. First Argument in Date Arithmetic Should Be a Date
PreviousPerform CalculationsNextMath Tags Null Value Error: Ending Position Out of Bounds (22) Stack Invalid Double
Last updated
Was this helpful?
This error means the first value in your date math is not a valid date.
S-Docs expects the first argument in <MATH type="date"> to be:
a date field
or a static date in yyyy-MM-dd format
If the value is missing, text-based, or actually a datetime field, the calculation fails.
This error usually happens when:
the field is blank
the field is not a date field
the field is a datetime field, not a date field
the math expression starts with plain text instead of a date value
This will fail because SERVICE INSTRUCTIONS is not a date:
SERVICE INSTRUCTIONS + DAYS(21)This can also fail if the merge field looks like a date to a user, but actually stores both date and time.
Start the math expression with a real date field.
You can also format the result on the <MATH> tag.
Check each date math block in your template source.
Then confirm these items:
the first value is a real date field
the field is not blank
the field is not a datetime field
the tag includes type="date"
If you are using a static date, use this format:
2026-03-24
Before you test again, confirm:
your tag starts with <MATH type="date">
the first argument is a date
static dates use yyyy-MM-dd
you are not using descriptive text in place of a date field
If a field includes both date and time, it may still fail in date arithmetic. Use a true date field whenever possible.
For a beginner walkthrough, see Get Started with Calculations.
Last updated
Was this helpful?
Was this helpful?
<MATH type="date">{{!Opportunity.CloseDate}} + DAYS(21)</MATH><MATH type="date" format-date="M/dd/yyyy">
{{!Opportunity.CloseDate}} + DAYS(21)
</MATH>
