Date Periods
The concept of rolling periods
Instead of writing fixed dates that become outdated, RevOpsQL offers rolling periods that automatically recalculate at each execution.
-- ❌ Fixed date: needs updating each month
WHERE createdate > '2025-04-01' AND createdate < '2025-04-30'
-- ✅ Rolling period: always last month
WHERE createdate IN LAST-MONTH
Key advantage: Save your query once, it stays always up to date. Perfect for recurring dashboards.
Available periods
Current period
| Period | Meaning |
|---|---|
THIS-WEEK |
From Monday (or Sunday depending on your portal) to Sunday |
THIS-WEEK-SO-FAR |
From the start of the week until today |
THIS-MONTH |
From the 1st to the last day of the current month |
THIS-MONTH-SO-FAR |
From the 1st of the month until today |
THIS-QUARTER |
Full current quarter |
THIS-QUARTER-SO-FAR |
From the start of the quarter until today |
THIS-YEAR |
From January 1st to December 31st |
THIS-YEAR-SO-FAR |
From January 1st until today |
Previous period
| Period | Meaning |
|---|---|
LAST-WEEK |
Full previous week |
LAST-MONTH |
Full previous month |
LAST-QUARTER |
Full previous quarter |
LAST-YEAR |
Full previous year |
Period-over-period comparison (SO-FAR)
| Period | Usage |
|---|---|
LAST-WEEK-SO-FAR |
Same progress previous week (WoW comparison) |
LAST-MONTH-SO-FAR |
Same progress previous month (MoM comparison) |
LAST-QUARTER-SO-FAR |
Same progress previous quarter (QoQ comparison) |
LAST-YEAR-SO-FAR |
Same progress previous year (YoY comparison) |
Rolling window
LAST-30-DAYS → the last 30 days
LAST-7-DAYS → the last 7 days
LAST-90-DAYS → the last 90 days
LAST-N-DAYS → N can be any integer
Concrete examples
-- Deals closed last month
SELECT dealname, amount
FROM deal
WHERE closedate IN LAST-MONTH
AND dealstage = 'closedwon'
-- Contacts created since the beginning of this week
SELECT email, firstname
FROM contact
WHERE createdate IN THIS-WEEK-SO-FAR
-- Activity from the last 30 days
SELECT email, firstname
FROM contact
WHERE createdate IN LAST-30-DAYS
Period-over-period comparison
The SO-FAR variant is particularly powerful for comparing your current performance with the same period of the previous month or quarter.
For example, if today is May 18:
THIS-MONTH-SO-FARcovers May 1st to May 18thLAST-MONTH-SO-FARcovers April 1st to April 18th
Two identical queries with these two periods give you a perfectly fair comparison.
RevOps tip: Use
LAST-QUARTER-SO-FARcombined withTHIS-QUARTER-SO-FARfor your QoQ reporting without ever manually changing dates.
Portal configuration
Periods automatically respect the timezone and first day of the week configured in your HubSpot portal.
| Region | First day of week |
|---|---|
| Europe | Monday (ISO 8601) |
| USA, Canada | Sunday |
| Middle East | Saturday |