Calculated Field Commands/Syntax

In Microsoft Dynamics 365, calculated fields let you automate manual calculations used in your business processes. The following options are available to you;


ADDDAYS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, plus the specified number of days.

Date and Time

ADDHOURS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, plus the specified number of hours.

Date and Time

ADDMONTHS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, plus the specified number of months.

Date and Time

ADDWEEKS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, plus the specified number of weeks.

Date and Time

ADDYEARS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, plus the specified number of years.

Date and Time

SUBTRACTDAYS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, minus the specified number of days.

Date and Time

SUBTRACTHOURS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, minus the specified number of hours.

Date and Time

SUBTRACTMONTHS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, minus the specified number of months.

Date and Time

SUBTRACTWEEKS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, minus the specified number of weeks.

Date and Time

SUBTRACTYEARS (whole number, date and time)

Returns a new date and time that is equal to the given date and time, minus the specified number of years.

Date and Time

DIFFINDAYS (date and time, date and time)

Returns the difference in days between two Date and Time fields. If both dates and times fall on the same day, the difference is zero.

Whole Number

DIFFINHOURS (date and time, date and time)

Returns the difference in hours between two Date and Time fields.

Whole Number

DIFFINMINUTES (date and time, date and time)

Returns the difference in minutes between two Date and Time fields.

Whole Number

DIFFINMONTHS (date and time, date and time)

Returns the difference in months between two Date and Time fields. If both dates and times fall on the same month, the difference is zero.

Whole Number

DIFFINWEEKS (date and time, date and time)

Returns the difference in weeks between two Date and Time fields. If both dates and times fall on the same week, the difference is zero.

Whole Number

DIFFINYEARS (date and time, date and time)

Returns the difference in years between two Date and Time fields. If both dates and times fall on the same year, the difference is zero.

Whole Number

CONCAT (single line of text, single line of text, … single line of text)

Returns a string that is the result of concatenating two or more strings.

String

TRIMLEFT (single line of text, whole number)

Returns a string that contains a copy of a specified string without the first N-characters.

String

TRIMRIGHT (single line of text, whole number)

Returns a string that contains a copy of a specified string without the last N-characters.

String


Related Information


Photo by Mikhail Nilov from Pexels

Previous
Previous

Make A Duplicate of Dynamics365 Environment

Next
Next

Microsoft Dynamics Pricing