I am trying to create a query that will give me the number of reports each employee did each day for the week. I have a query that pulls these results just fine, but there are some days where there are no reports submitted. I would like to still have those days listed in the query, with the number of reports at 0. I am going to use this query to export into a pivot table in excel. Currently, this is the pivot table that I am getting:
Tue Wed Thu Grand TotalD. Kassim 5 5J. Prickett 6 3 9M. Spence 1 1Grand Total 6 8 1 15
And I want it to look like this:
Mon Tue Wed Thu Fri Grand TotalD. Kassim 0 0 5 0 0 5J. Prickett 0 6 3 0 0 9M. Spence 0 0 0 1 0 1Grand Total 0 6 8 1 0 15
I have my weekly volume query that results in this information:
qWeekly_Volume Day Done By ComparisonsTue J. Prickett 6Wed D. Kassim 5Wed J. Prickett 3Thu M. Spence 1
I tried making a table with Mon-Fri listed for each employee:
tWeeklyVolume ID DayOfWeek EmpName ComparisonsCompleted 11Mon J. Prickett 12Tue J. Prickett 13Wed J. Prickett 14Thu J. Prickett 15Fri J. Prickett 16Mon D. Kassim 17Tue D. Kassim 18Wed D. Kassim 19Thu D. Kassim 20Fri D. Kassim 21Mon M. Spence 22Tue M. Spence 23Wed M. Spence 24Thu M. Spence 25Fri M. Spence
And created a select query that joined the day and the employee name together and then displayed the number of comparisons completed on a particular day for a particular employee, with an iif(IsNull( statement that would return a 0 if the person did not complete any comparisons that day. This is my SQL:
SELECT tWeeklyVolume.DayOfWeek, tWeeklyVolume.EmpName, IIf(IsNull([qWeekly_Volume].[Comparisons]),0,[qWeekly_Volume].[Comparisons]) AS Comparisons
FROM tWeeklyVolume LEFT JOIN qWeekly_Volume ON (tWeeklyVolume.EmpName = qWeekly_Volume.[Done By]) AND (tWeeklyVolume.DayOfWeek = qWeekly_Volume.Day);
It keeps giving me the error: “The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.”
I have no idea where this error is coming from or how to fix it. I tried making this an update query that would update the ComparisonsCompleted column in the tWeeklyVolume table, but this doesn't work either. The error comes from the day to day join, not the employee name join. Does anyone have any suggestions?