---
schema_version: "1"
id: 735fefb02dd3e53b1ea33d6b9d4a6c1855c671dcb6f7399a0dcdbbdad39b9ba9
title: Number of Days in the Month, Quarter, or Year
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/analytics/bi_dev_guide_saql/guides/reference/bi-saql-functions-numdays.md
canonical_url: https://developer.salesforce.com/docs/analytics/bi-dev-guide-saql/guide/bi-saql-functions-numdays.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 9833165f349fa008d3e67b564a37fd6341de8140e16f2a7d298395dc8c79f82f
products:
  - Analytics SAQL Developer Guide
  - analytics
---

# Number of Days in the Month, Quarter, or Year

Returns the number of days in the month, quarter, or year for the specified date.

## month_days(date)

Returns the number of days in the month for the specified date.

```nolang
q = foreach q generate month_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Month';
```

## quarter_days(date)

Returns the number of days in the quarter for the specified date.

```nolang
q = foreach q generate quarter_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Quarter;
```

## year_days(date)

Returns the number of days in the year for the specified date.

```nolang
q = foreach q generate year_days(toDate('CloseDate_sec_epoch')) as 'Billing Days In Year;
```
