quarters(X;Y)
Returns the number of quarters between two date-related values.
Syntax
quarters(X;Y)
Input
Argument | Type | Description |
---|---|---|
X |
any numeric type | A scalar value or the name of a column
containing date-related values Valid values can be of the form:
|
Y |
any numeric type | A scalar value or the name of a column
containing date-related values Valid values can be of the form:
|
For more information, see Dates and time.
Return Value
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 (1990) table
(pub.demo.weather.hourly90), you can create a computed column that
displays an integer value corresponding to the number of months between the first day of the
year and the date value in the column named date
:
<base table="pub.demo.weather.hourly90"/> <willbe name="example" value="quarters(firstdate(year(date));date)" label="Quarters Since`Beginning of Year"/> <colord cols="date,example"/>
year(X)
and
firstdate(X)
, in the calculation of the first argument.For a date value of 02/09/90
(X
=19900209), the result would be 0. (There
are 0 quarters from January 1 to February 9.)
For a date value of 10/15/90
(X
=19901015), the result would be 3. (There
are 3 quarters from January 1 to October 15.)