---
schema_version: "1"
id: 43d0dd1d7b526627e972db1cd29451fc4fdc0fbfd0b1ed6f5b57a735b2e3e384
title: year_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-year-last-day.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-sql/guide/bi-sql-date-year-last-day.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: c593185e4132022a46e081f5434b7e1a09cf63d31ebff5762d0fcaafcdd0d0ac
products:
  - SQL for Analytics Developer Guide
  - analytics
---

# year_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 year that contains the specified date.

## Example

```nolang
SELECT OrderDate as "date", year_last_day(OrderDate) as "year_last_day" FROM "dates_sample_data";
```

| date                | year_last_day       |
| ------------------- | ------------------- |
| 2015-01-21 15:30:00 | 2015-12-31 00:00:00 |
| 2015-01-21 00:00:00 | 2015-12-31 00:00:00 |
| 2015-01-31 10:00:30 | 2015-12-31 00:00:00 |
| 2015-02-03 15:30:00 | 2015-12-31 00:00:00 |
| 2016-01-21 23:59:59 | 2016-12-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-12-31 00:00:00 |
| 2016-01-11 03:30:00 | 2016-12-31 00:00:00 |
