User Tools

Site Tools


syntax:functions:yearquarter

YearQuarter(date)

Category: Date and Time function


Description

This function returns a time period formatted as year-quarter ("yyyy-Q#"), or an error if the argument is not a number date.


Arguments

ArgumentTypeDescription
dateDate or Number (date serial)A expression representing a date. See "Remarks" below for details.

Return value type: String


Remarks

The date argument can take any value or expression that evaluates to a date serial value, with or without a time portion. Examples include:

  • A date string: #2019-12-12
  • A date serial value: 43811 (the date serial for "2019-12-12")
  • A date value created using the Date function: date("2019-12-12","yyyy-MM-dd").


Examples

yearquarter(#2019-12-12)  //Returns "2019-Q4"
yearquarter(43889)  //Returns "2020-Q1" (43889 equivalent to February 28th, 2020)


See also

syntax/functions/yearquarter.txt · Last modified: 2025/03/18 17:16 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki