0
votes

I have a form, that provides the input for a query parameter.

This is my query: enter image description here

On my Form, Lead_whiteboard_nav, I have two text boxes. One 'StartDate' and the other 'EndDate' with multiple buttons a user can push to generate data about different machines, the criteria in the machine field (Each button runs a report from a different query). I assume these date fields are being used by the query, as whenever I generate a report using the query, I'm not prompted to enter values, therefore it seems that they are pulling from the form.

My problem is, that the reports using this query will use the criteria of the field 'Machine' - The right machine numbers are being pulled - However, the dates in the form don't seem to be applied. I get returned all values in the table for the given machine criteria.

Any suggestions?

1
In the GUI, you can change Machine.DATA criteria to: 304 Or 305 or 306Gustav

1 Answers

1
votes

You should not use the query builder for anything more than basic queries, imo.

The problem is that you have multiple OR conditions, but you specify this Between condition for the first of them.

Change your condition for the Machine field to the following: IN(304, 305, 306) to have a more efficient query and avoid this bug.

This would all be very evident if you'd look at the SQL.