code L
04-27-2010, 07:17 AM
I have 2 tables DIRproject and DIRrequest.
In DIRproject i have: projectname, dateAdded, addedBy
In DIRrequest i have: projectname, NumOfDrawing
what i want is to populate a table of info with projectname, dateAdded, addedBy, NumOfRequest and totalqty.
below is my sql, i got an error that say "I am trying to include a variable that is not included in aggregate function".
how to solve this anyone! :confused:
SELECT DIRproject.projectname, DIRproject.dateAdded, DIRproject.addedBy, count(DIRrequest.projectname) as NumOfRequest, sum(DIRrequest.NumOfDrawing) as totalqty
FROM DIRproject INNER JOIN DIRrequest
ON(DIRproject.projectname=DIRrequest.projectname)
WHERE #now()# - DateRequested <= #pastDay#
GROUP BY DIRproject.projectname
In DIRproject i have: projectname, dateAdded, addedBy
In DIRrequest i have: projectname, NumOfDrawing
what i want is to populate a table of info with projectname, dateAdded, addedBy, NumOfRequest and totalqty.
below is my sql, i got an error that say "I am trying to include a variable that is not included in aggregate function".
how to solve this anyone! :confused:
SELECT DIRproject.projectname, DIRproject.dateAdded, DIRproject.addedBy, count(DIRrequest.projectname) as NumOfRequest, sum(DIRrequest.NumOfDrawing) as totalqty
FROM DIRproject INNER JOIN DIRrequest
ON(DIRproject.projectname=DIRrequest.projectname)
WHERE #now()# - DateRequested <= #pastDay#
GROUP BY DIRproject.projectname