Hi,
I have created a query to enable staff to report on monitoring reports for our grants and determine how many we have outstanding and how long organisations took to send in their monitoring etc. I need to be able to filter the query by our respective countries and also by status. However, the query won't filter the country ID when I include the filter by 'Active' OR 'Completed' and returns all records instead. If I only filter by Active and filter by country ID it works fine. Am I missing something?
I have used the query builder in Access but the SQL is below:
Any help would be appreciated.
I have created a query to enable staff to report on monitoring reports for our grants and determine how many we have outstanding and how long organisations took to send in their monitoring etc. I need to be able to filter the query by our respective countries and also by status. However, the query won't filter the country ID when I include the filter by 'Active' OR 'Completed' and returns all records instead. If I only filter by Active and filter by country ID it works fine. Am I missing something?
I have used the query builder in Access but the SQL is below:
Code:
SELECT
GrantsT.GrantURN,
GrantsT.OrganisationName,
GrantsT.CountryID,
GrantsT.Status,
GrantsT.StatusDate,
GrantsT.ProjectStart,
GrantsT.ImpactDue,
GrantsT.Received,
GrantsT.ProjectCompleted,
GrantsT.EndOfProjectVisit,
[Received] - [ImpactDue] AS [Days Overdue]
FROM
GrantsT
WHERE
(
((GrantsT.CountryID) = 3)
AND ((GrantsT.Status) = "Active")
)
OR (((GrantsT.Status) = "Completed"))
ORDER BY
GrantsT.ImpactDue;
Any help would be appreciated.