yrmo(X)

Returns the month form of a date-related value.

Syntax

yrmo(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 month form (YYYYMM) of a 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 month form of the date value in the column named date:

<base table="pub.demo.weather.hourly93"/>
<willbe name="example" value="yrmo(date)" label="Month Form" format="type:nocommas"/>
<colord cols="date,example"/>
Note: The computed column is formatted using the nocommas display format so that the result will appear without commas (i.e., 199301 as opposed to 199,301).

For a date value of 10/21/93 (X=19931021), the result would be 199310.

For a date value of 02/07/93 (X=19930207), the result would be 199302.