| DATE$( ) DATE$(date_value, 2-digit year switch) DATE$(\"format\", date_value) |
Date Function Returns a String Value
Returns the string representation for the numeric date value. This function is useful when you want to use other string functions with a date field
(which is numeric).
Function Use
This function is typically used when formatting how dates are displayed or returned. This function is not typically used when filtering records. Consider using the MKDATE( ) or DATENUM( ) function for date-based filtering.
Formatting
You can use Optional Switches or Format Modifiers to determine how the date is displayed.
Optional switches of 0 or 1 can be used to determine the date format. DATE$( ) or DATE$(0) will format the date with a 4-digit year (i.e., "mm/dd/yyyy"), whereas DATE$(1) will format the date with a 2-digit year (i.e., "mm/dd/yy").
Additionally, format modifiers can be used to specify the format displayed for the date including the use of leading zeros, spelling out the day or month, and if it is displayed as 2 or 4-digit year. Commas and additional text used in this function will be displayed in the output (e.g., "Tuesday, March 8th" or "8th day of March"). Format modifiers must be enclosed in quotation marks and must come before the date_value. Format modifiers are case insensitive.
If the optional switches and format modifiers are not used, the date displays using the mm/dd/yyyy format. If no date_value is specified, the current system date is used.
Note: Switches and format modifiers cannot be used together in the same function statement.
Format Modifiers:
| Modifier | Result | Example | Value if Empty1 |
| %m | month with leading zeros | 04/06/2026 | mm |
| %n | month without leading zeros | 4/6/2026 | mm |
| %o | month spelled out (long) | April 06, 2026 | Month |
| %p | month spelled out (short all-caps) | APR 06, 2026 | MTH |
| %d | day with leading zeros | 04/06/2026 | dd |
| %e | day without leading zeros | 4/6/2026 | dd |
| %f | day with modifier (st, nd, rd, etc.) | April 6th, 2026 | ddth |
| %g | day of the week (long) | Monday, April 6th, 2026 | Day |
| %h | day of the week (short) | Mon, April 6th, 2026 | Day |
| %y | 2-digit year | 04/06/26 | yy |
| %z | 4-digit year | 04/06/2026 | yyyy |
1 When a specified date field is empty (e.g., Date of Birth, Opened Date, etc.), values will be represented by a placeholder for the field (e.g., if %m, then mm; if %y, then yy, etc.).
Formatting Examples
Examples using Optional Switches
When using the optional switches, only the year will be affected; month and day will always be displayed as "mm/dd".
DATE$( )
...or...
DATE$(0)
Returns the current system date in string form using the default "mm/dd/yyyy" format.
Returns
"08/04/2026" if the current system date is August 4, 2026.
DATE$(1)
Returns the current system date in string form using the alternate "mm/dd/yy" format.
Returns
"08/04/26" if the current system date is August 4, 2026.
DATE$(DATENUM( ) + 7)
Returns "10/08/26" if the System Date is 10/01/26.
Examples using Format Modifiers
When using format modifiers, only the portion of the date that a modifier is entered for will be displayed. If no modifier for the month is entered, the month will not be displayed.
DATE$("%p")
Returns "APR" if the current month is April.
DATE$("%g")
Returns "Monday" if the current day is Monday.
DATE$("%f day of %o, %z")
Returns "2nd day of April, 2026" if the system date is 04/02/2026.
DATE$("%h, %o %f", MKDATE(3,3,26))
Returns "Tues, March 3rd".
DATE$("%n/%e/%y", MKDATE(3,3,26))
Returns "3/3/26".
DATE$("%d %p %y", MKDATE(3,3,26))
Returns "3 MAR 26".
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)
| See also: | TODAY$( ) |