views:

13

answers:

0

I looked through similiar questions and attempted to apply to my situation with no avail:

I am counting the number of projects aborted in a month (between [begin date] and [end date]) which works as long as there were any projects aborted, however most months there are none and I need to return a result of zero. I created a table (LU_RFP-Proposal Report Types) to query the results of aborted with a join to the project table:

SELECT [LU_RFP-Proposal Report Types Query].Type, 
       [LU_RFP-Proposal Report Types Query].Field1, 
       Nz(Count(*), 0) AS CountOfProjectID, 
       [Project_RFPs Aborted].[Due Date], 
       [Project_RFPs Aborted].Status
FROM [LU_RFP-Proposal Report Types Query] 
    LEFT JOIN [Project_RFPs Aborted] 
        ON [LU_RFP-Proposal Report Types Query].[Field1] 
            = [Project_RFPs Aborted].[Status]
GROUP BY [LU_RFP-Proposal Report Types Query].Type, 
         [LU_RFP-Proposal Report Types Query].Field1, 
         [Project_RFPs Aborted].[Due Date], 
         [Project_RFPs Aborted].Status
HAVING ((([LU_RFP-Proposal Report Types Query].Type)="RFPs Aborted") 
    AND (([LU_RFP-Proposal Report Types Query].Field1)="Aborted") 
    AND (([Project_RFPs Aborted].[Due Date]) 
        Between [Enter Begin Due Date] And [Enter End Due Date]) 
    AND (([Project_RFPs Aborted].Status)="Aborted"));

Thanks!!!