# Limit or validate parameter of type 'date'

**URL:** <https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436>\
**Category:** Q&A\
**Tags:** feature-request, quick-sight\
**Created:** [September 19, 2023, 4:59pm UTC](https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436 "2023-09-19T16:59:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehulz](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mehulz](https://community.amazonquick.com/u/mehulz)\
**Post date:** [September 19, 2023, 4:59pm UTC](https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436/1 "2023-09-19T16:59:34Z")

</div>

Hello, Is there a way to limit value selection, or validate a parameter of type date?

I have added a parameter of type “Datetime”, and added the control for date selection. I want to limit how far user can go back to select the date to say last month or last 30 days only. Is this possible? Or is there a way to validate the parameter after user selects it so that I can limit how far user can select?

![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/1/1c2e0080afce1603f17b7aaf784f87181484fc28.png)

Thanks

---

<div class="post-metadata">

**Author:** ![abacon](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/abacon/32/2291_2.png) [@abacon](https://community.amazonquick.com/u/abacon)\
**Post date:** [September 20, 2023, 9:49am UTC](https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436/2 "2023-09-20T09:49:14Z")

</div>

Hi @mehulz

Thanks for posting your question and welcome to the Quick Sight Community.

It isn’t possible to place this limit on the parameter control, but I wonder if you could use calculated fields that check whether the parameter control date is within a range? I created a calculated field **dateBoundaryCalc** as follows

```auto
ifelse(dateDiff(timestamp,${pDate})>30,"Out of bounds","In bounds")

```

Building a simple table visual results in this

 ![image](https://d1wl4jav5dp96l.cloudfront.net/original/2X/8/83dfcccd009acca694d1aa89bf603886977e861a.png)

This would allow your calculations to take different actions depending on whether the date selected in the parameter control is within a specific range of your dataset data, or not.

Many Thanks,  
Andrew

---

<div class="post-metadata">

**Author:** ![mehulz](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mehulz](https://community.amazonquick.com/u/mehulz)\
**Post date:** [September 20, 2023, 11:59am UTC](https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436/3 "2023-09-20T11:59:11Z")

</div>

Thank you Andrew. I will try this out, and let you know.  
Mehul

---

<div class="post-metadata">

**Author:** ![mehulz](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mehulz](https://community.amazonquick.com/u/mehulz)\
**Post date:** [September 20, 2023, 1:29pm UTC](https://community.amazonquick.com/t/limit-or-validate-parameter-of-type-date/18436/4 "2023-09-20T13:29:37Z")

</div>

Hi Andrew, Thank you for your suggestion. I was able to do following:

1. Created a calculated field for difference between start date and end date
2. Added a new filter to show results only if calculated field \< 30

Thanks once again.  
Mehul
