Day of Quarter

Returns an integer that represents the day of the quarter for a specific date. The first quarter of the year begins on January 1.

Example

SELECT OrderDate as "date", EXTRACT (DOQ FROM OrderDate) as "day_of_quarter" FROM "dates_sample_data";
date day_of_quarter
2015-01-21 15:30:00 21
2015-01-21 00:00:00 21
2015-01-31 10:00:30 31
2015-02-03 15:30:00 34
2016-01-21 23:59:59 21
2015-10-31 23:59:59 31
2015-12-03 00:00:00 64
2016-01-11 03:30:00 11
2016-01-11 03:30:00 11