officeguru
MIS
Greetings,
I have two tables that track publications submitted for proofing. Table 1[BOM Review] holds the name of the writer[Leader], the ID of the publication [Pub #], the date it passes review and a checkbox [Status] indicating it has passed. Table 2[Rejections] is related on publication ID[Pub no] and holds the date and reason for any rejections.
I wrote a query to total all documents for each writer that have passed review. Then total all documents that were never rejected. Dividing the latter by the former should give a percentage of documents that passed without rejection.
The problem I am having is that when a publication is rejected more than once, it is counted as more than one completed publication. I thought I could fix this by using the SELECT DISTINCT or SELECT DISTINCTROW but it doesn't work. Can someone see the error in my thinking?
Thanks
Brian
SELECT DISTINCTROW [BOM Review].Leader, Sum(IIf([BOM Review].[status]=True,1,0)) AS Pubs, Sum(IIf([rejections].[id] Is Null,1,0)) AS Clean, [Clean]/[Pubs] AS [Pass Rate]
FROM [BOM Review] LEFT JOIN Rejections ON [BOM Review].[Pub #] = Rejections.[Pub no]
WHERE ((([BOM Review].Date) Between [forms]![Report Date Range]![beginDate] And [forms]![Report Date Range]![endDate]))
GROUP BY [BOM Review].Leader;
I have two tables that track publications submitted for proofing. Table 1[BOM Review] holds the name of the writer[Leader], the ID of the publication [Pub #], the date it passes review and a checkbox [Status] indicating it has passed. Table 2[Rejections] is related on publication ID[Pub no] and holds the date and reason for any rejections.
I wrote a query to total all documents for each writer that have passed review. Then total all documents that were never rejected. Dividing the latter by the former should give a percentage of documents that passed without rejection.
The problem I am having is that when a publication is rejected more than once, it is counted as more than one completed publication. I thought I could fix this by using the SELECT DISTINCT or SELECT DISTINCTROW but it doesn't work. Can someone see the error in my thinking?
Thanks
Brian
SELECT DISTINCTROW [BOM Review].Leader, Sum(IIf([BOM Review].[status]=True,1,0)) AS Pubs, Sum(IIf([rejections].[id] Is Null,1,0)) AS Clean, [Clean]/[Pubs] AS [Pass Rate]
FROM [BOM Review] LEFT JOIN Rejections ON [BOM Review].[Pub #] = Rejections.[Pub no]
WHERE ((([BOM Review].Date) Between [forms]![Report Date Range]![beginDate] And [forms]![Report Date Range]![endDate]))
GROUP BY [BOM Review].Leader;