Hi,
I have the following query that I cannot get to work.
Select * from tblIssueIncident LEFT OUTER JOIN tblIssueUpdate ON tblIssueIncident.MyIssueIncidentID=tblIssueUpdate.IssueIncidentID where [tblIssueIncident.SiteID]= 87 AND [tblIssueIncident.StatusID] IN(1 , 2, 99) AND ([tblIssueIncident.StatusID] = 2 AND [IssueCloseDate] > Date() - 7);
This is a dynamic query that is build based on a form. The tricky part has to do with the last 2 parts of the query...
One of the fields that the user can select one or more of, to be included in the resulting report, is 'Status' (1=Open, 2=Closed, 3=Pending, ect). However, I want to give users the option to always print 'Closed' (StatusID = 2) issues that were closed in the last week (that is, the IssueCloseDate > Todays Date - 7 days). You can see that I have parenthasized the last clause in the statement in the hopes that it would consider the 2 parts together :
([tblIssueIncident.StatusID] = 2 AND [IssueCloseDate] > Date() - 7)
It is not working. Could someone tell me how to tell the query to take these 2 query clauses together?
Hope this made sense. Thanks in advance!
Arch
I have the following query that I cannot get to work.
Select * from tblIssueIncident LEFT OUTER JOIN tblIssueUpdate ON tblIssueIncident.MyIssueIncidentID=tblIssueUpdate.IssueIncidentID where [tblIssueIncident.SiteID]= 87 AND [tblIssueIncident.StatusID] IN(1 , 2, 99) AND ([tblIssueIncident.StatusID] = 2 AND [IssueCloseDate] > Date() - 7);
This is a dynamic query that is build based on a form. The tricky part has to do with the last 2 parts of the query...
One of the fields that the user can select one or more of, to be included in the resulting report, is 'Status' (1=Open, 2=Closed, 3=Pending, ect). However, I want to give users the option to always print 'Closed' (StatusID = 2) issues that were closed in the last week (that is, the IssueCloseDate > Todays Date - 7 days). You can see that I have parenthasized the last clause in the statement in the hopes that it would consider the 2 parts together :
([tblIssueIncident.StatusID] = 2 AND [IssueCloseDate] > Date() - 7)
It is not working. Could someone tell me how to tell the query to take these 2 query clauses together?
Hope this made sense. Thanks in advance!
Arch