---
schema_version: "1"
id: 3f38d0ce57b4ce5cfdb327469110fe1c7bd7e64125d92b877e4b0e90c1a3296b
title: quarter_last_day({date})
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-quarter-last-day.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-quarter-last-day.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 8132ca5f1d7464af51018cc25a5fcaea7e4010273fb8556eeadba857c196cfc4
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# quarter_last_day({date})

Accepts a `DateTime`, `DateOnly`, or legacy Date object as input. Returns an object of the same type that corresponds to the last day of the quarter that contains the specified date.

## Example

```nolang
SELECT OrderDate as "date", quarter_last_day(OrderDate) as "quarter_last_day" FROM "dates_sample_data";
```

| date                | quarter_last_day    |
| ------------------- | ------------------- |
| 2015-01-21 15:30:00 | 2015-03-31 00:00:00 |
| 2015-01-21 00:00:00 | 2015-03-31 00:00:00 |
| 2015-01-31 10:00:30 | 2015-03-31 00:00:00 |
| 2015-02-03 15:30:00 | 2015-03-31 00:00:00 |
| 2016-01-21 23:59:59 | 2016-03-31 00:00:00 |
| 2015-10-31 23:59:59 | 2015-12-31 00:00:00 |
| 2015-12-03 00:00:00 | 2015-12-31 00:00:00 |
| 2016-01-11 03:30:00 | 2016-03-31 00:00:00 |
| 2016-01-11 03:30:00 | 2016-03-31 00:00:00 |
