- Local time
- Today, 17:26
- Joined
- Sep 28, 2010
- Messages
- 83
Folks,
Have a quick nose at the following query...
At present the DCOUNT in expr1 is returning all Jobs with a ret call equal to N, and I can see why, but what I can't quite work out is how to get expr1 to only carry out this DCOUNT against the jobs found by the initial SELECT / Count ...
Any thoughts gratefully received!
TIA..
Have a quick nose at the following query...
Code:
SELECT Engineers.Engineer_Name, Count(dbo_ReportData.[Job No]) AS [CountOfJob No], DCount("[Ret Call]","[dbo_reportdata]","[Ret Call]= 'N'") AS Expr1
FROM Engineers INNER JOIN dbo_ReportData ON Engineers.Engineer_ID = dbo_ReportData.Engineer
WHERE (((dbo_ReportData.[Log Num]) In (1,2,3,5,6,24,12,36,99)) AND ((dbo_ReportData.[Completion Date])>=Date()-31) AND ((Engineers.Department)="HD"))
GROUP BY Engineers.Engineer_Name
ORDER BY Count(dbo_ReportData.[Job No]) DESC;
At present the DCOUNT in expr1 is returning all Jobs with a ret call equal to N, and I can see why, but what I can't quite work out is how to get expr1 to only carry out this DCOUNT against the jobs found by the initial SELECT / Count ...
Any thoughts gratefully received!
TIA..