Team... I need your help... SELECT Pickerid, Sum(Currentweight) AS TotalWeight, IIf(pickerhours=0,0,TotalWeight/pickerhours) FROM mergeddatabase WHERE ((Currentdate) between [Enter First Date Required:] and [Enter Last Date Required:]) GROUP BY pickerid, pickerhours; I have a access database (2003) single Table (mergeddatabase) with thousands of entries.. This is a query to work out picking rates. The criteria is a picker picks a box and information like currentdate, currentweight, pickerid, pickerhours etc is appended to each record. There are hundreds of records per pickerid each day. What Im trying to do is total all entries for that pickerid within a certain date range.. Ie pickerid = 1 date = 18/03/2012, currentweight = 4.06, hrs = 2 pickerid = 1 date = 19/03/2012, currentweight = 5.08, hrs = 2 pickerid = 4 date = 18/03/2012, currentweight = 4.09, hrs = 3 pickerid = 4 date = 19/03/2012, currentweight = 4.11, hrs = 5 So the result should show Pickerid 1, currentweight 9.14, avgweight = (currentweight / hrs) Pickerid 4, currentweight 8.2, avgweight = (currentweight / hrs) I hope this makes sense.
March 21, 2012 3:49 AM
March 25, 2012 10:24 PM