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

# COMPARE TO

> Compare the date range with an earlier period.

`COMPARE TO` runs the report a second time over an earlier period, and shows both side by side.

```sql theme={null}
FROM sales
  SHOW net_sales, orders
  DURING last_month
  COMPARE TO previous_year
```

| Period | Compares with |
| - | - |
| `previous_period` | The same number of days just before the range |
| `previous_year` | The same dates a year earlier |
| `previous_year_match_day_of_week` | A year earlier, moved so the days of the week line up |

Matching the day of the week keeps weekend trade comparable with weekend trade.

`COMPARE TO` needs a date range from [DURING or SINCE](https://docs.queryful.app/queryfulql/syntax/since-until-during.md). To add percent change columns, use [WITH PERCENT\_CHANGE](https://docs.queryful.app/queryfulql/syntax/with.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.