Add condition to current query

M

mike17316

I have a current query and the user is requesting an update by adding only
Event.Status that are "Open", only for the StartCount records. I can't seem
to get it right. Thank you for the help!

PARAMETERS [Enter Start Date] DateTime, [Enter End Date] DateTime;
SELECT Event.[Event Type], Event.Priority, DCount("*","[Event]","[Event
Type] = '" & [Event Type] & "' AND [Priority] = '" & [Priority] & "' AND
[Received Date] < #" & [Enter Start Date] & "#") AS StartCount,

Sum(IIf(Event.Status="Open",1,0)) AS NbrRecd,

DCount("*","[Event]","[Event Type] = '" & [Event Type] & "' AND [Priority]
= '" & [Priority] & "' AND [Close Date] < #" & [Enter End Date]+1 & "# AND
[Close Date] >= #" & [Enter Start Date] & "#") AS NbrClosed

FROM Event

WHERE (((Event.[Received Date])>=[Enter Start Date] And
(Event.[Received Date])<[Enter End Date]+1) AND
((Event.[Event Reference]) Is Not Null)) OR
(((Event.[Received Date])>#12/31/2099#) AND ((Event.[Event Reference]) Is
Not Null))

GROUP BY Event.[Event Type], Event.Priority;
 

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