# Parameters - End date should always be greater than Start Date

**URL:** <https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330>\
**Category:** Q&A\
**Tags:** admin, error, quick-sight\
**Created:** [July 18, 2025, 7:42pm UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330 "2025-07-18T19:42:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![priyanka1](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@priyanka1](https://community.amazonquick.com/u/priyanka1)\
**Post date:** [July 18, 2025, 7:42pm UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/1 "2025-07-18T19:42:19Z")

</div>

I have created the custom sql, and created and added the parameter in dataset level itself.  
Custom SQL:  
SELECT  
date,  
count  
FROM xxx.yyyyyy  
WHERE date \>= COALESCE(CAST(\<\<$StartDate\>\> AS TIMESTAMP) AT TIME ZONE ‘UTC’, ‘1900-01-01’::timestamp)  
AND date \<= COALESCE(CAST(\<\<$EndDate\>\> AS TIMESTAMP) AT TIME ZONE ‘UTC’, ‘2200-01-01’::timestamp)  
AND count \> 0

Now I have added the controls through parameters after mapped. Now all I need is, if I try to select April 01 2025 then end date should always be greater than or equals to april 01 2025, end data should not show before dates. How can I acheive this?

---

<div class="post-metadata">

**Author:** ![Yamini\_Baskar\_24](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/yamini_baskar_24/32/23078_2.png) [@Yamini\_Baskar\_24](https://community.amazonquick.com/u/Yamini_Baskar_24)\
**Post date:** [July 19, 2025, 3:23am UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/2 "2025-07-19T03:23:16Z")

</div>

Hi Priyanka,  
If you are trying to select April 1 2025 as value in the end date control then that should give you the expected result. If that’s not the case. Can you provide additional information about with which control are we trying to attend this output and also parameter type info could also be helpful.

Thanks  
Yamini

---

<div class="post-metadata">

**Author:** ![priyanka1](https://avatars.discourse-cdn.com/v4/letter/p/3ab097/32.png) [@priyanka1](https://community.amazonquick.com/u/priyanka1)\
**Post date:** [July 22, 2025, 8:07am UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/3 "2025-07-22T08:07:06Z")

</div>

Thank you for your support @Yamini_Baskar_24

I’m working with two date filters in Quick Sight: Start Date and End Date. By default, both filters display the full range of available dates (months, years, days), which is expected.

However, I’m trying to implement the following logic:

When a Start Date is selected (for example, April 4, 2023), the End Date filter should only show dates on or after the selected Start Date.

Additionally, if the user selects an End Date that is earlier than the Start Date, I want to prevent the KPIs or visuals from showing any data. They should only reflect results when the End Date is greater than or equal to the Start Date.

Is there a way to enforce this kind of dynamic filtering or validation in Quick Sight (either through parameter configuration, calculated fields, or controls)?

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [August 9, 2025, 3:19pm UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/4 "2025-08-09T15:19:09Z")

</div>

Hi @priyanka1

Please refer the below community post this might be helpful for you.

> [@Restrict Date Parameter value selection](https://community.amazonquick.com/t/restrict-date-parameter-value-selection/15232/4):
>
> Hello @Vignesh_Kannan , if your parameter allows the user to enter any date for start and end period it is not possible to prevent them to enter dates that are not valid according to your business logic. Here one option that you have is to create two calculated fields (one for each date) and then perform a validation using a calculated field, e.g. validation: ifelse(dateDiff(start\_date, end\_date ,"MM") \>= 12, "Dates are invalid, please select a range of 12 months between startd and end date"…

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [August 23, 2025, 10:12am UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/5 "2025-08-23T10:12:31Z")

</div>

Hi @priyanka1

It’s been a while since we last heard from you. If you have any further questions, please let us know how we can assist you.

If we don’t hear back within the next 3 business days, we’ll proceed with close/archive this topic.

Thank you!

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [August 27, 2025, 5:09pm UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/6 "2025-08-27T17:09:13Z")

</div>

Hi @priyanka1

Since we have not heard back from you, I’ll go ahead and close/archive this topic. However, if you have any additional questions, feel free to create a new topic in the community and link this discussion for relevant information.

Thank you!

---

<div class="post-metadata">

**Author:** ![Xclipse](https://d2orw1595917va.cloudfront.net/user_avatar/community.amazonquick.com/xclipse/32/20455_2.png) [@Xclipse](https://community.amazonquick.com/u/Xclipse)\
**Post date:** [August 27, 2025, 5:09pm UTC](https://community.amazonquick.com/t/parameters-end-date-should-always-be-greater-than-start-date/48330/7 "2025-08-27T17:09:47Z")

</div>


