# Date Range Component on Report Viewer

**URL:** <https://forum.inductiveautomation.com/t/date-range-component-on-report-viewer/36839>\
**Category:** Ignition\
**Created:** [July 17, 2020, 10:52pm UTC](https://forum.inductiveautomation.com/t/date-range-component-on-report-viewer/36839 "2020-07-17T22:52:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pajmera](https://avatars.discourse-cdn.com/v4/letter/p/b9e5f3/32.png) [@pajmera](https://forum.inductiveautomation.com/u/pajmera)\
**Post date:** [July 17, 2020, 10:52pm UTC](https://forum.inductiveautomation.com/t/date-range-component-on-report-viewer/36839/1 "2020-07-17T22:52:06Z")

</div>

Hello,  
I’ve created a report using Basic SQL Query and used the date range component in the report viewer. My report is working as it should, however, when I change the dates in the range component, the report doesn’t seem to update based on the dates provided. I’ve bound the StartDate property of report to the Start Date property of date range and made it bidirectional. A similar thing is done for the end date too.

I was looking to some topics on the same question and have tried to update my SQL Query based on the t\_stamp as mentioned below:

```auto
SELECT * FROM Refrig_Tags
WHERE t_stamp >= {StartDate}
AND t_stamp < {EndDate}

```

However, I get an error with the format I believe. Can anyone suggest me to do it in a better way?

Thanks in advance.  
Priyanshu

---

<div class="post-metadata">

**Author:** ![Rendi.Yohanes](https://avatars.discourse-cdn.com/v4/letter/r/a183cd/32.png) [@Rendi.Yohanes](https://forum.inductiveautomation.com/u/Rendi.Yohanes)\
**Post date:** [July 18, 2020, 11:22am UTC](https://forum.inductiveautomation.com/t/date-range-component-on-report-viewer/36839/2 "2020-07-18T11:22:25Z")

</div>

Please take a look at this part of the manual:  
[https://docs.inductiveautomation.com/display/DOC80/Basic+SQL+Query](https://docs.inductiveautomation.com/display/DOC80/Basic+SQL+Query)

There’s some datetime/string manipulation if you want to use that default Start/EndDate parameters with Basic SQL Query.

Another alternative as advised by Ignition trainer is as follows:  
_“Rather than converting your StartDate and EndDate report parameters to strings, you can use a query type of “SQL Query”, then use “?” characters in your query to inject parameters. This will gracefully handle dates passed in from the Report Viewer component.”_
