Skip to main content
Question

Query Designer and Date Parameter


Forum|alt.badge.img+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.

2 replies

Forum|alt.badge.img+5
  • Author
  • Do Gooder (Employee)
  • 17 replies
  • November 30, 2023

Anyone?


PhillBronson
Hero (Customer)
Forum|alt.badge.img+10
  • Hero (Customer)
  • 112 replies
  • August 5, 2024

I suspect that this is an issue because you can't set the datatype of the parameter in queries

I believe you should be able to set the datatype for the parameter using lobby

 

Did you ever resolve your issue?


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings