Quarter

sql

FUNCTION Quarter(IN dt DATE) RETURNS INT;

Parameters

dt date

Description

The Quarter function gets the year quarter from the dt date. This function can be used for queries and other objects when you need to get quarterly sales etc.

Function value

This function returns the quarter number (range 1 to 4). Returns NONEINTEGER (NULL) for dt=NONEDATE.

Example (SQL):

...

SELECT Quarter(dt),SUM(price)
FROM Invoices96
GROUP BY Quarter(dt)