day(X)

Returns the day portion of a date-related value.

Syntax

day(X)

Input

Argument Type Description
X integer or decimal A scalar value or the name of a column containing date-related values
Valid values can be of the form:
  • date
  • date+time

For more information, see Dates and time.

Return Value

Returns the integer value corresponding to the day portion of the date-related value given as input.

If the input values are not in one of the supported formats listed above, the function returns an erroneous or illogical output.

Example

In the Hourly U.S. Weather (1993) table (pub.demo.weather.hourly93), you can create a computed column that displays an integer value corresponding to the day portion of the date value in the column named date:

<base table="pub.demo.weather.hourly93"/>
<tabu label="Example: day(X)" breaks="date">
  <tcol source="date" fun="cnt" label="Count"/>
</tabu>
<willbe name="example" value="day(date)" label="Day"/>
<colord cols="date,example"/>

For a date value of 01/07/93 (X=19930107), the result would be 7.