> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-user-manual/maps/sql-parameters/date-parameter.md).

# Date parameter

**Date Parameters** define a default data range to be used in your query, with the start date and end date as placeholders. These parameters are always used in pairs, representing the start and end of a selected time period.

## **Date Parameter Settings**

When creating a Date Parameter, you'll need to configure:

### **Values**

Set the default start and end dates that will be pre-filled in the calendar. These do not restrict what users can select—users can adjust the dates freely.

<figure><img src="/files/Tz29Ky1OJL7WJ5nD4xih" alt=""><figcaption><p><em>Defining Default Start and End dates</em></p></figcaption></figure>

### **Naming**

* **Display name:** The name that will appear in the control UI.
* **SQL name(s):** The name to be used in the SQL query to be replaced by the starting and ending date of the selected period.

## **Using Date Parameters in your SQL Query**

After creating the parameter, add it manually to your SQL query using its placeholders:

```sql
SELECT * FROM `carto-demo-data`.demo_tables.fires_worldwide
WHERE acq_date > {{date_from}} AND acq_date < {{date_to}}
```

Once added, the date picker will appear int he right-side panel, allowing users to adjust the range and see the data source update in real time.

<figure><img src="/files/gIVi2pakqnn9TFsnPoE9" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.carto.com/carto-user-manual/maps/sql-parameters/date-parameter.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
