# Reporting - Usage of start date and end date parameters

**URL:** <https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539>\
**Category:** Ignition\
**Created:** [April 19, 2016, 4:31pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539 "2016-04-19T16:31:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhamoorthy](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@sudhamoorthy](https://forum.inductiveautomation.com/u/sudhamoorthy)\
**Post date:** [April 19, 2016, 4:31pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/1 "2016-04-19T16:31:20Z")

</div>

Hi,

I have created a report, which has to get the historical data from database, based on start date and end date. I have used Basic SQL query for this as given below.

```
SELECT transaction_group_table.[Turbine_1_ Power_Output],
  transaction_group_table.[Turbine_2_ Power_Output,
  Format(transaction_group_table.[t_stamp],'yyyy-MM-dd') as t_stamp	 
FROM transaction_group_table
where transaction_group_table.[t_stamp] between {StartDate} and {EndDate}

```

I have formatted the startdate and enddate parameters in this format “yyyy-MM-dd”.

I’m not getting the results using the above query. What am I missing. Please help.

---

<div class="post-metadata">

**Author:** ![Curlyandshemp](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@Curlyandshemp](https://forum.inductiveautomation.com/u/Curlyandshemp)\
**Post date:** [April 20, 2016, 7:47pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/2 "2016-04-20T19:47:48Z")

</div>

[quote=“sudhamoorthy”]Hi,

I have created a report, which has to get the historical data from database, based on start date and end date. I have used Basic SQL query for this as given below.

```
SELECT transaction_group_table.[Turbine_1_ Power_Output],
  transaction_group_table.[Turbine_2_ Power_Output,
  Format(transaction_group_table.[t_stamp],'yyyy-MM-dd') as t_stamp	 
FROM transaction_group_table
where transaction_group_table.[t_stamp] between {StartDate} and {EndDate}

```

I have formatted the startdate and enddate parameters in this format “yyyy-MM-dd”.

I’m not getting the results using the above query. What am I missing. Please help.[/quote]

I have found with the new reporting module that I get better results if I create a WhereClause parameter and pass string values into report.

look at this thread and scroll to bottom [inductiveautomation.com/forum/v … 72&t=15446](https://inductiveautomation.com/forum/viewtopic.php?f=72&t=15446)

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [April 20, 2016, 8:52pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/3 "2016-04-20T20:52:56Z")

</div>

In general, when you are using parameters in a reporting query, you should use the regular SQL Query, not the Basic SQL Query. In the regular SQL Query, replace {StartDate} and {EndDate} with question marks, and you will get some expression editor boxes at the bottom of your screen. In those editors, you can enter any valid expression, including {StartDate}

---

<div class="post-metadata">

**Author:** ![sudhamoorthy](https://avatars.discourse-cdn.com/v4/letter/s/c5a1d2/32.png) [@sudhamoorthy](https://forum.inductiveautomation.com/u/sudhamoorthy)\
**Post date:** [April 21, 2016, 4:21am UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/4 "2016-04-21T04:21:34Z")

</div>

Thanks a lot for your help, Kathy. That solved my issue. 🙂

---

<div class="post-metadata">

**Author:** ![tom.ha](https://avatars.discourse-cdn.com/v4/letter/t/8491ac/32.png) [@tom.ha](https://forum.inductiveautomation.com/u/tom.ha)\
**Post date:** [December 12, 2019, 6:36pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/5 "2019-12-12T18:36:23Z")

</div>

Hi Kathy,

I did the same way but data do not show on table of report

 ![date](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/aca28769ff60c79ce46ae56b85403fb528eb0ccc.png)

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [December 12, 2019, 7:32pm UTC](https://forum.inductiveautomation.com/t/reporting-usage-of-start-date-and-end-date-parameters/11539/6 "2019-12-12T19:32:24Z")

</div>

Check the Preview panel to see if you are getting any data back with your query. (The XML on the right pane of that panel). If you are, then it’s an issue with your table – you might not have associated the data source with the table correctly
