Using Dates in Formulas for Smart Forms

Modified on Fri, 29 Nov, 2024 at 8:56 AM

Using Dates in Formulas for Smart Forms

Some Smart forms require formulas to reference dates, either manually inputted dates, or reading from the Gantt. In this example group we have some date functions at play with some fields not shown but are required for the calculations. 

 

  • “Today” is the current date (it does reply on the scheduled job performing a full recalculation every day)
  • “Tomorrow” adds a day to the current date
  • “Days Previous” is taken off the current date to give “New Date”
  • “Diff” is the difference between Date 1 and Date 2

We can add days (positive and negative) to dates and calculate the differences between dates.

This is done via the following:

  • A new field type – Numeric Function For Dates
  • System variable – TODAY
  • Adding a suffix of “N” to Date Function fields (and the new TODAY variable) to return a decimal representation of a date.
  • Adding a suffix of “D” to the Numeric Function For Dates fields to return a date from a decimal.

 

The above group has the following fields:

 Field

Description

Type

Function

Display

ID854

Today

Date Function

TODAY

Yes

ID855

TodayPlusOne

Numeric Function For Dates

TODAYN + 1

No

ID856

Tomorrow

Date Function

ID855D

Yes

ID857

Days Previous

Numeric

 

Yes

ID858

PrevDate

Numeric Function For Dates

TODAYN - ID857

No

ID859

New Date

Date Function

ID858D

Yes

ID860

Date 1

Date

 

Yes

ID861

Date 2

Date

 

Yes

ID862

d1

Date Function

ID860

No

ID863

d2

Date Function

ID861

No

ID864

Diff

Numeric Function

ID863N- ID862N

Yes

 


Help with Formulas

There are tooltips within the formulas page which can assist with formatting.  Hover over any of the 'Show help for' options on the right-hand side.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article