Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Applies to: ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the start of the month containing the date, shifted by an offset, if provided.
startofmonth(
date [,
offset ])
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
date | datetime |
✔️ | The date for which to find the start of month. |
offset | int |
The number of months to offset from the input date. The default is 0. |
A datetime representing the start of the month for the given date value, with the offset, if specified.
range offset from -1 to 1 step 1
| project monthStart = startofmonth(datetime(2017-01-01 10:10:17), offset)
Output
monthStart |
---|
2016-12-01 00:00:00.0000000 |
2017-01-01 00:00:00.0000000 |
2017-02-01 00:00:00.0000000 |