chead5
Active Member
- Joined
- Jun 7, 2004
- Messages
- 356
I have a parameter query that uses cell values to feed the query.
It basicly looks at <b>Reviewer_ID, CSR_ID, and Review_Date</b> and it works fine with just one reviewer.
What I need is the for the parameter for <b>Reviewer_ID</b> to accept up to four cells' values.
<ul>If all of the cells are empty I need the query to return all of the results for the given agent and date.
If there are any cells with data I need it to just return data based on the values in the cells</ul>
A simple <b>Or</b> operator won't work because if the reviewer cells are all empty I get no results.
Here is the current Where statement with the Or operator:
<code>WHERE (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?)</code>
Any Ideas on modifying this?
It basicly looks at <b>Reviewer_ID, CSR_ID, and Review_Date</b> and it works fine with just one reviewer.
What I need is the for the parameter for <b>Reviewer_ID</b> to accept up to four cells' values.
<ul>If all of the cells are empty I need the query to return all of the results for the given agent and date.
If there are any cells with data I need it to just return data based on the values in the cells</ul>
A simple <b>Or</b> operator won't work because if the reviewer cells are all empty I get no results.
Here is the current Where statement with the Or operator:
<code>WHERE (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?) OR (tblMasterLP.Reviewer_ID=?) AND (tblMasterLP.CSR_ID=?) AND (tblMasterLP.Review_Date Between ? And ?)</code>
Any Ideas on modifying this?