I'm currently trying to streamline a chain of queries in a database and could use some imput. As it stands right now the first two queries are independant, one pulls information from a form, and another from a table. The third query (the current problem query) is where they are combined and filtered. After some trial and error i've found that the filter slows down the query signifigantly (difference between a few minutes (5-6) and a second) and began to wonder if i'm going about this the right way.
The current filter...
Criteria is set for "True"
Month1..3Cost is calculated in the third query and uses variables from the form and table query. Claim Status comes from the table query.
I basically need to show only records that have any costs associated to them for the three month period or are still in an open status.
Is this the right way to go about this or is there a more efficient method that i'm not aware of?
It may also be important to note that there is another field in the query that is pulled from the table query and filtered by a field from the form query. I've already duplicated the problem query (one for each filter), but it doesn't make a difference thats noticible in the slightest.
The current filter...
Code:
Filter: IIf([Month1Cost]<>0 Or [Month2Cost]<>0 Or [Month3Cost]<>0 Or [ClaimStatus] = "Open","True","False")
Criteria is set for "True"
Month1..3Cost is calculated in the third query and uses variables from the form and table query. Claim Status comes from the table query.
I basically need to show only records that have any costs associated to them for the three month period or are still in an open status.
Is this the right way to go about this or is there a more efficient method that i'm not aware of?
It may also be important to note that there is another field in the query that is pulled from the table query and filtered by a field from the form query. I've already duplicated the problem query (one for each filter), but it doesn't make a difference thats noticible in the slightest.