system.tag.queryTagHistory() not fetching results

Hello,
I am using the following code which returns 0 rows:

endTime = system.date.now()
startTime = system.date.addMinutes(endTime, -30)
system.tag.queryTagHistory(paths=['[default]Stations/Station1/Devices/UDT1/Booltag1'], startDate=startTime, endDate=endTime, returnSize=-1, returnFormat='Wide')

I have another piece of code for another application which works well and returns expected results for the same tag:

data = system.tag.queryTagHistory(
            paths=[dynamictagpath], startDate=start_time, endDate=end_time,
            intervalHours=24, aggregationMode="Maximum", returnSize=X
        )

Is there a problem with the syntax or anything else?

Thanks in advance :slight_smile:

Are you sure you have samples recorded in that timeframe? Consider setting max time between samples on your tags to an interval smaller than the smallest desired chart timespan.