> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stockful.app/llms.txt
> Use this file to discover all available pages before exploring further.

# COMPARE TO

> Compare the date range against a prior period for deltas

`COMPARE TO` runs your report a second time over an earlier period and shows the difference. It gives you period-over-period deltas without having to build two reports.

```sql theme={null}
FROM sales
  SHOW total_revenue, units_sold
  DURING this_month
  COMPARE TO previous_period
```

## Comparison periods

| Period              | What it compares against                                    |
| ------------------- | ----------------------------------------------------------- |
| `previous_period`   | The period of the same length immediately before your range |
| `previous_year`     | The same dates one year earlier                             |
| `previous_year_dow` | The same dates one year earlier, aligned by day of week     |

`previous_year_dow` shifts the prior year so weekdays line up, which keeps weekend-heavy trade comparable.

Pair `COMPARE TO` with a date range set by [DURING or SINCE and UNTIL](/stockfulql/syntax/since-until-during). To turn the comparison into percent-change columns, add [WITH PERCENT\_CHANGE](/stockfulql/syntax/with).
