QUARTER Function [Date and Time]

Returns a number indicating the quarter of the year from the supplied date expression.

Syntax

QUARTERdate-expression )

Parameters

Parameter

Description

date-expression

A date.

Returns

INT

Example

With the DATE_ORDER option set to the default of ymd, the following statement returns the value 2:

SELECT QUARTER ( '1987/05/02' ) FROM iq_dummy

See Reference: Statements and Options > Database Options > Alphabetical List of Options > DATE_ORDER Option.

Usage

This table lists the dates in the quarters of the year.

Values of quarter of the year

Quarter

Period (inclusive)

1

January 1 to March 31

2

April 1 to June 30

3

July 1 to September 30

4

October 1 to December 31

Standards and Compatibility

  • SQL—Vendor extension to ISO/ANSI SQL grammar.

  • Sybase—Not supported by Adaptive Server Enterprise.