Hi there
what i'm trying to do is something of the sort...
SELECT TOP 10 AVG(items.field1) AS field1, AVG(items.field2) AS field2, items.date, items.staff_no, staff.staff_name, staff.staff_no
RIGHT JOIN staff ON staff.staff_no = items.staff_no
WHERE
items.dags >=#01.12.2004# AND
items.dags <=#31.12.2004# AND
AVG(items.field1) > 1500
GROUP BY staff.staff_no
ORDER BY AVG(items.field1) DESC
of course i cannot use the date field like above cause it is a part of the table that i'm grouping on. I've tried all sorts of sub-query schemes, i imagine that is the solution, but to no gain.
if anyone could assist me with this it would be greatly appreciated
thanks in advance
what i'm trying to do is something of the sort...
SELECT TOP 10 AVG(items.field1) AS field1, AVG(items.field2) AS field2, items.date, items.staff_no, staff.staff_name, staff.staff_no
RIGHT JOIN staff ON staff.staff_no = items.staff_no
WHERE
items.dags >=#01.12.2004# AND
items.dags <=#31.12.2004# AND
AVG(items.field1) > 1500
GROUP BY staff.staff_no
ORDER BY AVG(items.field1) DESC
of course i cannot use the date field like above cause it is a part of the table that i'm grouping on. I've tried all sorts of sub-query schemes, i imagine that is the solution, but to no gain.
if anyone could assist me with this it would be greatly appreciated
thanks in advance