Query Criteria Question.

G

Guest

The query I'm currently running is not giving me the desired results. The
intention of the query is to return any records that contain 1 of 2 (or both)
fields that are true, and are within specified dates.

WHERE ((([Event Log].OccurenceDate) Between [Start Date] And [End]) AND
((([CPS].[ACCOL]) Like -1)) OR ((([CPS].[All CPS]) Like -1)));

The above SQL is doing 1/2 the job. It's returning any values that are
between the prompted dates for the field ACCOL. It is also returning any
records that match ALL CPS, but its not considering the dates.

I can get the desired result by running another query upon this query, but
if at all possible I would like to avoid that route.

Any help would be very much appreciated.
 
G

Guest

I just solved my problem.

The SQL now is:
WHERE ((([Event Log].OccurenceDate) Between [Start] And [End]) AND
(([CPS].[ACCOL]) Like -1)) OR ((([Event Log].OccurenceDate) Between [Start]
And [End]) AND (([CPS].[All CPS]) Like -1));

For some reason I tried this yesterday and it wasn't working.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top