Report designer data

Hello everyone
I have a query that shows information between two dates and it show it into a table

Then I have the preview of the report ; where @datasetStart and datasetEnd shows the dates

image

The question is:
Is there a way to put the value of both @dataset into the query instead of the 2024-01-01 00:00:00' AND '2024-02-04 23:59:59'

Something as between @datasetStart AND @datasetEnd
Because, depending of the date of datasetStart and datasetEnd, will show information in the table of the report per date range

Yes you can.
Replace the manually entered dates with placeholders "?". Define the start date and end date as parameters and select these in the SQL query where the "?" placeholders are. These values can be bound to a UI, so the dates selected by the user will be passed into the query.
Refer this for detailed info,

1 Like

Tip: you are doing something wrong when writing on forum. Somehow you have formatted your post as </> code so the text does not wrap. This can happen if you add four or more spaces at the start of a line. Check your posts in the preview window before posting. Thanks.

1 Like

Please don't ping people who haven't responded to the thread. I can assure you that it doesn't encourage them to answer.

Considering the amount of information that you have blocked out, which pretty much results in us not being able to see the structure of the query, and that your posts for this issue appear to be urgent, I would recommend that you call support. They can work under an NDA, and will be able to resolve your issue much quicker because they can have access to your project that we can not.

Otherwise, rather than posting an image with most of the important information blocked out, perhaps work up an example that illustrates the same need and structure. You will probably get better help.

At this point, I'm not really sure exactly what your issue is.

Been a while since I've touched the reporting module, but is this the documentation you are looking for?
Basic SQL Query | Ignition User Manual (inductiveautomation.com)

2 Likes

Please don't ping me. I read everything on this forum, and help where circumstances permit.

In the text of the query, where you have the quoted static dates, replace them with single question marks (no quotes). This will cause a parameter field to show for each below the query text, where you can place your parameters. Consider just using the StartDate and EndDate standard parameters.

Do NOT change the query type to the Basic SQL Query.

I know, I did that but I tried to put the parameters of the dates that I had, but did not worked, maybe I don't know if I can pass my dates to the standart dates

These dates are getting of pushing a button
image

You'll have to be more descriptive than that. What, exactly, did you get? And what did the SQL Query look like? If you got any data in your preview, what did that look like?

I get columns as Name, motive, description these between a range of time .
In this case I put '?'

and added a parameter of the date that I have in my report designer:

I don't think you can use an expression in a query parameter like that. It also looks like you are trying to use strings as dates--that is unreliable, if it even works at all. Provide proper Ignition datetime objects (like the supplied StartDate and EndDate parameters).

You are also trying to reference content in a dataset parameter with syntax I've never seen. (Dataset parameters are evil for anything other than scripting data sources.)