| DATEADD( ) DATEADD(number, interval, date_value) |
Date Function Returns a String Value
Returns the string representation for a numeric date value using the "mm/dd/yyyy" format. This function adds or subtracts the specified values (number + interval + date_value) to return a past or future date.
- The first parameter (number) is the numeric amount of adjustment to make.
- The second parameter (interval) represents a code for the interval of time that will be adjusted, such as days, weeks, months, etc.; this code must be enclosed in quotation marks.
| "y" | years | |
| "m" | months | |
| "e" | weekdays (weekends are not counted) | |
| "d" | days (weekends are counted) | |
| "w" | weeks |
- The third parameter (date_value) specifies the starting date, for which the number and interval are based on. If omitted, date_value defaults to the value of DATENUM( ), which is the current system date.
Note: When using the weekdays interval ("e"), holidays are not considered when returning a value. If the date provided falls on a weekend, the returned value will be based on the previous Friday.
Function Use
This function can be used when filtering records or formatting how dates are displayed or returned.
Filtering Examples
The following examples are ways in which you can use this function to filter records.
You want to see all Statements dated in the last two weeks.
(Date <= TODAY()) and (Date >= DATEADD(-2,"w"))
Formatting Examples
DATEADD(-1,"m")
Returns 02/18/2026 if the current system date is 03/18/2026.
DATEADD(1,"w",MKDATE(4,14,2026))
Returns 04/16/2026.
DATEADD(10,"e",MKDATE(4,14,2026))
Returns 04/28/2026.
DATEADD(1,"e",MKDATE(04/12/2026))
Returns 04/14/2026 since 04/12/2026 is on a Saturday.
Tip: The DATEADD( ) function is similar to the MKDATE( ) function, but in some scenarios may be easier to use.
Other Resources
- Expression Examples
- Filtering Records
- Knowledge Base Article R11493 - All About Expressions
- Knowledge Base Article R11515 - Filter Expression Examples
- Knowledge Base Article R11487 - Working with Indexes, Filters, and QuickViews
- Knowledge Base Article R10750 - Report Writer, Filter, and WorkFlow Functions (provides link to downloadable .pdf)