I have the following query:
and when I try to parse it, I receive the following error:
Column 't.specminutes' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
can someone tell me what I'm missing here? Thank you
Doug
Code:
SELECT name, employeenumber, summinutes, sum(summinutes/60) as hours, specminutes, sum(specminutes/60) as sphours FROM ( SELECT scratchpad2.name, scratchpad2.employeenumber, SUM(scratchpad2.minutes) + SUM(scratchpad2.totalminutes) as summinutes, SUM(scratchpad2.minutes) + SUM(scratchpad4.totalminutes) as specminutes, FROM scratchpad2 INNER JOIN scratchpad4 ON scratchpad2.employeenumber = scratchpad4.employeenumber GROUP BY scratchpad2.name, scratchpad2.employeenumber ) t GROUP BY name, employeenumber, summinutes
Column 't.specminutes' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
can someone tell me what I'm missing here? Thank you
Doug
Comment