Date

Use this function to build a date from a given date, or from the current date.

Syntax

Date (Format, Day, Month, Year)

Parameter

Description

Format

Enter a date format. The default is format 1 (MM/DD?YY).

Day

Enter an integer day value. The default is based on the current day.

Month

Enter an integer month value. The default is based on the current month.

Year

Enter an integer year value. The default is based on the current year.

The system returns a date string that contains a formatted date value. If you omit any of the Day, Month, or Year parameters, the system uses a value based on the current date.

Note To change to some date formats, make sure the variable field’s Type field (on the field’s Properties window) is set to alphanumeric.

Example

Here are some examples:

(Assume the current date is 07/01/10.)

Function

Result

Explanation

Return(Date( ))

07/01/2010

No parameters entered, defaults to current date in date format 1.

Return(Date("44"))

July 1, 2010

Date format 4 selected, with a four-digit year length. Defaults to the current date in the selected format.

Return(Date

( ,18,5,2009))

05/18/2010

Defaults to date format 1 using the given values.

Return(Date("I2",18,5))

10/138

Date format I selected with a two-digit year length. Enters the given date values in the selected format.

See also