OK, this works, but here is another question. Here is my resultant SQL, and it works fine:
SELECT Hours.ProgramNumber AS ProgramNumber, Hours.ProgramName AS ProgramName, Hours.Project AS ProjectNumber, Hours.ProjectName AS ProjectName, Ref_Employee.Job AS Job, Sum(Hours.Hours) AS SumOfHours
FROM Ref_Employee INNER JOIN Hours ON Ref_Employee.Name = Hours.Engineer
GROUP BY Hours.ProgramNumber, Hours.ProgramName, Hours.Project, Hours.ProjectName, Ref_Employee.Job, Hours.WeekEnding
HAVING (((Hours.WeekEnding) Between [Enter Start Date:] And [Enter End Date:]));
I want this to show up in a form, and I already had the form working, but when I paste in the SQL into the code, it no longer works:
Report.RecordSource = "SELECT Hours.ProgramNumber As ProgramNumber, Hours.ProgramName As ProgramName, Hours.Project As ProjectNumber, Hours.ProjectName As ProjectName, Ref_Employee.Job As Job, Sum(Hours.Hours) AS SumOfHours FROM Ref_Employee INNER JOIN Hours ON Ref_Employee.Name = Hours.Engineer GROUP BY Hours.ProgramNumber, Hours.ProgramName, Hours.Project, Hours.ProjectName, Ref_Employee.Job HAVING (((Hours.WeekEnding) Between [Enter Start Date:] And [Enter End Date:]));"
The error I get is: You tried to run a query that does not include the specified expression 'Hours.Weekending Between [Enter Start Date:] And [Enter End Date:]' as part of the aggregate function.
How can I get this to work?
Thanks in advance!
Jon