Show TOC

Background documentationDate Functions Locate this document in the navigation structure

 

Function

Description

Syntax

Examples

DATE

Returns the date specified by the given year, month, and day values in the default format.

DATE(year,month,day)

DATE(2005,4,23)

Compiles the year, month and day values into a formatted date. In this case, the following might be returned: 23/4/2005

DADD

Increases/decreases a date value by the specified number of date (d) units. The unit part is optional and defaults to ‘D’ (days).

DADD(d,n,[unit])

where unit is one of the items listed in the Date Units table

DADD(@CREATE_DATE,4,'D')

Adds 4 days to the value returned. In this case, 24/4/2009 would be converted to 28/4/2009 .

DADD(@CREATE_DATE,11,'M')

Adds 11 months to the value returned. In this case, 24/4/2009 would be converted to 24/3/2010 .

DADD(@CREATE_DATE,-3,'Y')

Subtracts 3 years from the value returned. In this case, 24/4/2009 would be converted to 24/3/2006 .

DGET

Returns the numeric value of the specified date (d) unit.

DGET(d,unit)

where unit is one of the items listed in the Date Units table

DGET(@CREATE_DATE,'M')

Returns only the value of the specified time unit from within the date value. In this case, 30.05.2002 would return 5, while 27.02.2004 would return 2

DSTR

Converts a date object to a formatted string. The format part is optional, and defaults to 'DATE'.

DSTR (d,[format])

where format is one of the items listed in the Date Formats table

DSTR(@DATE_FIELD,'MON DD, YYYY')

Converts the date value returned to a string. In this case, 30.05.2002 would be converted to May 30, 2002

DSTR(DADD(@CREATE_DATE,13,'D'),'XML_DATE')

Using the DADD function, this expression adds 13 days to the returned date, and then converts the date format to the XML standard format. In this case, 30.05.2002 would be converted to: 2002-06-12

DSUB

Returns the difference between two date objects, in the specified date unit. The unit part is optional and defaults to ‘D’ (days).

DSUB(d1,d2,[unit])

where unit is one of the items listed in the Date Units table

DSUB(NOW(),@CREATE_DATE,'D')

Calculates the difference between the two date objects, specified here, in days. In this case, values of 16.09.2007 (today) and 05.8.2007 for these two fields would return 39

DVAL

Converts a string containing a date value to a date object.

DVAL(str)

TVAL(str)

DVAL(@TIME_FIELD)

Converts a string containing a date value to a date object. For example, '30.05.06' would be converted to the date object that represents the date 30/05/2006

NOW

Returns the current date.

NOW()

NOW()

Returns the current calendar date, such as: 27/06/2006