%DatePart meta-SQL element

Syntax

%DatePart(DTTM_Column)

Description

The %DatePart meta-SQL variable returns the date portion of the specified DateTime column.

Note:

This meta-SQL variable is not implemented for COBOL.

Parameters

Parameter Description

DTTM_Column

Specify the datetime column from which you want to return the date.

Considerations using %DatePart

Use %DateOut meta-SQL when fetching values, as in the following example:

%DateOut(%DatePart(DTTM_COLUMN)) from some_table

If a literal is used as the parameter to %DatePart, it must be wrapped in %DateTimeIn:

insert into some_table values(%DatePart(%DateTimeIn('2001-01-01-12.34.56.789012')))