> 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="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-45c689b47899439c99e4649175fbd984ecbe9f22%2Fimage.png?alt=media" 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 in the parameters bar above the map, allowing users to adjust the range and see the data source update in real time.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-10e498015841b641ba9fbe5cf5fb57fee42e36d4%2Fimage.png?alt=media" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
