Report Nested Query issue

I’m tryin to use the report parameters StartDate and EndDate wihtin a query datasource, which is a nested query. See image for setup

The highlighted “?” are supposed to use the report parameters, the first “?” is supposed to refer to the
parent query result.

I keep getting the error below

image

If I hardcode some dates in like ‘2021/09/13 12:00:00.000’ and ‘2021/10/13 11:03:10.000’, including the single quote, it works just fine.

The return types of the parameters are DATE
StartDate = dateArithmetic(now(), -8, “hr”)
EndDate = now()

I’ve tried CASTing the parameters like below

image

it always returns a time out error.

image

If I try this in the Query Builder or in SSMS it works fine…

Using Ignition 8.16.

Your first parameter is blank.

When it’s blank it’s supposed to refer to the parent query result…

You can’t leave it blank. The parent result is a row. You need a column reference to get a value from that row. (And where did you get the idea it could be blank?)

Your right, it can not be blank…I thought the parameter was blank when I started testing WITHOUT the date range checking and there were no error reported…going back to that code I see that it defaulted the parameter to the parent SQL query column name…I could’ve swear it was blank yesterday :smiley:

1 Like

Working now…without CASTing too!

1 Like

My question is related to the nested query but bit different.

I want to use IN clause in query but while passing parameters I am getting issue.
It works for single parameter value but not for a string of multiple parameter values. I tried almost all possible ways to form an expression in parameters but didn't get result. What expression syntax am I missing here? Please suggest.
I am trying hardcoded parameters values here just to check.

This is main query:

This is child query:

In most cases, particularly in named queries and in the report builder, placeholder parameters can only take single values, not lists. Where you wish to use IN, you must generate multiple question marks. Only scripted "Prep" queries can do this.

@pturmel Got it !!
Can you give some example how to prepare the query in my case?