You are here: Functions > DATE()

DATE()

Use the DATE() function to convert the current system date or an optional date field or expression, into a 12 byte character string representation of the date.

Function Format

DATE(<D>,<“date_format”>)

If no parameters are supplied, the system date is converted. Otherwise, the optional supplied date field or expression D is converted.

Note: Any time portion of a DateTime value is ignored.

In either case, by default the date is returned in the format specified by the Date Display Format in the Data Options tab in Analyzer or via the Set Date command. This can be overridden by specifying the optional date_format.

For more information see Date Display Format or Set with Preference Equivalents.

Examples

Using the default date settings of MM/DD/YY, a system date of Nov 22, 1995 and a date field called DATEFLD with a value of Dec 31, 1995:

DATE() = "11/22/95"

DATE(DATEFLD) = "12/31/95"

DATE(DATEFLD,”YYYY-MM-DD”) = “1995-12-31”