# Scheduled Reports: StartDate/EndDate Parameters

**URL:** <https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050>\
**Category:** Ignition\
**Created:** [September 29, 2025, 11:27am UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050 "2025-09-29T11:27:08Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jordan.heape](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jordan.heape](https://forum.inductiveautomation.com/u/jordan.heape)\
**Post date:** [September 29, 2025, 11:27am UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050/1 "2025-09-29T11:27:09Z")

</div>

Hello,

I am trying to run a daily report. I want the report to execute at 5 am every day and the values from the tags in the data source to be from 3 am that day. When I do a preview using StartDate todate('2025-09-25 00:03:00') and EndDate now() everything looks like it should in the report.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9af1b91cc5b95e139ca299560df278fb10d5f9c4.png)

However, the report schedule is using the StartDate parameter:

todate(stringFormat('%s-%s-%s 03:00:00',getYear(now()),getMonth(now()),getDayOfMonth(now))

and EndDate:

addDays(todate(stringFormat('%s-%s-%s 03:00:00',getYear(now()),getMonth(now()),getDayOfMonth(now)),1)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/8/0878933199cd3b3fd7a7d33943b5db99e3fe5ead.png)

Which appears to be breaking the output on the report itself. It only shows the header values and none of the tag values.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/8/28efe3ee44b4b1351dfc5b9ca644ec82f7874fd8.png)

I will note that I am new to reporting in Ignition and scripting in general and had to get someone to send me something to try for the StartDate and EndDate parameters. I am hoping the seasoned vets can help me out.

Thanks

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 29, 2025, 12:03pm UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050/2 "2025-09-29T12:03:17Z")

</div>

> [@jordan.heape](#):
>
> todate(stringFormat('%s-%s-%s 03:00:00',getYear(now()),getMonth(now()),getDayOfMonth(now))
> 
> and EndDate:
> 
> addDays(todate(stringFormat('%s-%s-%s 03:00:00',getYear(now()),getMonth(now()),getDayOfMonth(now)),1)

This is going the long way around to get your needed dates. I usually do something like this

```typescript
addHours(midnight(now(0)),3) // 3am of current date

```

you can reference other parameters in expressions, so for `endDate` you could do this

```typescript
addDays({startDate},1)

```

---

<div class="post-metadata">

**Author:** ![jordan.heape](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@jordan.heape](https://forum.inductiveautomation.com/u/jordan.heape)\
**Post date:** [September 29, 2025, 1:28pm UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050/3 "2025-09-29T13:28:59Z")

</div>

Ok. I will try that! We were able to get the report to work by changing the expression a little bit to this:

todate(stringFormat('%s-%s-%s 03:00:00', toint(getyear(now(0))),toint(getmonth(now(0)))+1, toint(getdayofmonth(now(0)))))

And changing the endDate to:

now(0)

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [September 29, 2025, 1:30pm UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050/4 "2025-09-29T13:30:45Z")

</div>

That expression is an atrocity, don’t use it 😉

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [September 29, 2025, 2:11pm UTC](https://forum.inductiveautomation.com/t/scheduled-reports-startdate-enddate-parameters/111050/5 "2025-09-29T14:11:06Z")

</div>

Using string parsing after string formatting is **extremely** unwise. It is both slow and subject to subtle flaws, particularly in regards to timezones and midnight crossings. Don't do it.
