Hopefully, someone can help me.
I have a qry that I am looking to get all resources, the total time each resource worked, and also show the resources that didn't book any time. This query works perfectly when I have no selection critera, and shows all 540 resources.
When I enter selection criteria to limit by date range, I get 467 records. I have done some research, and what I am getting is all those resources that have booked time in the given range, with thier total time for that date range, and all resources that have NEVER booked time. What I am missing is the resources that, at some point, booked time, but not in this time frame.
My SQL statement is as follows:
Any suggestions? I pull the dates from a form. Thank you!
I have a qry that I am looking to get all resources, the total time each resource worked, and also show the resources that didn't book any time. This query works perfectly when I have no selection critera, and shows all 540 resources.
When I enter selection criteria to limit by date range, I get 467 records. I have done some research, and what I am getting is all those resources that have booked time in the given range, with thier total time for that date range, and all resources that have NEVER booked time. What I am missing is the resources that, at some point, booked time, but not in this time frame.
My SQL statement is as follows:
Code:
SELECT tblMain_ResourcePool.Cost_Center, tblMain_ResourcePool.Corp_ID, Sum(tblMain_AutoTeamTime.Hours) AS SumOfHours
FROM tblMain_ResourcePool LEFT JOIN tblMain_AutoTeamTime ON tblMain_ResourcePool.Corp_ID = tblMain_AutoTeamTime.Badge_ID
WHERE (((tblMain_AutoTeamTime.Date) Between [Forms]![frmCostCenterSelection]![txtFrom] And [Forms]![frmCostCenterSelection]![txtTo] Or (tblMain_AutoTeamTime.Date) Is Null))
GROUP BY tblMain_ResourcePool.Cost_Center, tblMain_ResourcePool.Corp_ID
HAVING (((tblMain_ResourcePool.Cost_Center)<>"DD" And (tblMain_ResourcePool.Cost_Center)<>"1324" And (tblMain_ResourcePool.Cost_Center)<>"6724"))
ORDER BY tblMain_ResourcePool.Cost_Center, tblMain_ResourcePool.Corp_ID;
Any suggestions? I pull the dates from a form. Thank you!