Question

Query Designer and Date Parameter

  • 8 November 2023
  • 1 reply
  • 111 views

Userlevel 2
Badge +5

I’ve used the Query Designer to create a projection query that includes a date field. I’ve added a filter parameter for that field, since I want the date applied to the filter to be dynamic. The documentation says I should be able to use a context substitution variable in the datasource designer with that parameter.

However, when I use #TODAY# as the parameter value on the datasource, I can see that the substitution is adding single quotes around the date value, producing a datatype mismatch error. The request header shows the URL looks like this:

/main/ifsapplications/projection/v1/QueryProjectionReliability_Monitor_Due_Count_By_Assembly.svc/GetReliability_Monitor_Due_Count_By_Assembly(CurrentDate='2023-11-07')?$select=AssemblyTypeCode,CountOfMonitorDue&$orderby=AssemblyTypeCode&$top=25&$skip=0

Note the single quotes added to 2023-11-07, turning it into a string value. If I manually remove the single quotes, the URL returns the expected payload.

How do I keep the #TODAY# CSV from adding these extraneous quotes?

Edit: I’ve found that even if I add a specific date value in the datasource, such as 2023-11-07, quotes will automatically be added in the URL, resulting in the same issue. This appears not to be a CSV issue, but rather than DATE type parameters in datasources may be being converted into string values incorrectly.


1 reply

Userlevel 2
Badge +5

Anyone?

Reply