---
schema_version: "1"
id: 827123351cb7547904ccc289fd2ac871f26ca67e99ae378cf6d44812b5db007c
title: Day of Quarter
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_sql/guides/bi-sql-date-doq.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-doq.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 222ea9f375fb4ca82c26188c5d5ace4fdfef3d5c40929e3497bfdc23ceed35e4
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# 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

```nolang
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             |
