# startOfMonth() in CQL: syntax and examples for Confluence

URL: https://goingstellar.ro/reference/cql/startofmonth/

startOfMonth() is the first moment of the current month. Use it for month-to-date counts and for monthly reports that compare against the previous month. "-1M" moves it to the first of last month.

## Syntax

```
startOfMonth()
startOfMonth("inc")
```

## Arguments

- `inc` (optional: no): Optional offset in the form (+/-)nn(y|M|w|d|h|m): y year, M month, w week, d day, h hour, m minute. Quoted. With no sign, plus is assumed. The unit is required and case sensitive, and the offset moves the boundary.

## Works with

- Fields: created, lastmodified
- Operators: =, !=, >, >=, <, <=
- Not with: ~, !~, IN, NOT IN (checked on Confluence Cloud, November 2026: `created ~ startOfMonth()` is rejected)

## Examples

```
created >= startOfMonth()
```

Content created so far this month. This is the documentation example. Run on Confluence Cloud on 2026-11-29.

```
created >= startOfMonth("-1M") AND created < startOfMonth()
```

All content created in the previous calendar month, for a monthly report that does not change after the 1st. Run on Confluence Cloud on 2026-11-29.

```
lastmodified >= startOfMonth("-1M") AND lastmodified < startOfMonth() AND space = SD
```

Pages in one space that were edited last month, to compare activity month over month. Run on Confluence Cloud on 2026-11-29.

```
lastmodified < startOfMonth("-6M") AND type = page AND space = SD
```

Pages nobody has touched for more than six full months, a first list for a content review. Run on Confluence Cloud on 2026-11-29.

```
type = page AND creator = currentUser() AND created >= startOfMonth()
```

Your own pages from this month, for a personal summary or a monthly timesheet note. Run on Confluence Cloud on 2026-11-29.

## Pitfalls

- Month and minute differ only by case. `startOfMonth("-1M")` resolves to the first of last month, while `startOfMonth("-1m")` resolves to 23:59 on the last day of last month, one minute before the boundary (checked on Confluence Cloud, November 2026).
- On the official functions page, startOfMonth() is marked up as a level-3 heading, so it sits inside the startOfDay() section, while the other functions have their own level-2 headings. A table of contents built from the page nests it under startOfDay().
- A bare number is refused: `startOfMonth("-1")` fails with "Invalid relative date : -1" (HTTP 400). Always add `M`, `d` or another unit.
- Using it with `IN` fails with "Operator 'in' is not supported for field 'created'". Combine two comparisons with AND instead.

## Related

- [startOfYear()](https://goingstellar.ro/reference/cql/startofyear/)
- [startOfWeek()](https://goingstellar.ro/reference/cql/startofweek/)
- [endOfMonth()](https://goingstellar.ro/reference/cql/endofmonth/)
- [created](https://goingstellar.ro/reference/cql/created-field/)
- [lastmodified](https://goingstellar.ro/reference/cql/lastmodified-field/)
- [currentUser()](https://goingstellar.ro/reference/cql/currentuser/)

## Sources

- [CQL functions (Atlassian Developer, Confluence Cloud)](https://developer.atlassian.com/cloud/confluence/cql-functions/)

