jd_boss_hogg
09-17-2009, 10:30 PM
Hi All,
I'm getting the 'not part of aggregate function' error on a SQl. After looking through previous posts, i can see that it's because i'm grouping some of my fields (using SUM) but not others. The trouble i have, is i don't understand what i have to do with them in the SQL.
I have a report which has a few fields in the header that calculate some sum values. Further down the report, i then want to list these individually in the 'details' section of the report, grouped by [worktype].
Here is the simplified version of the code...
SELECT
Sum (IIf (([jb-2001].WORKTYPE="Chrome Mask") , [jb-2001].NET, 0 )) AS Glass1,
Sum (IIf (([jb-2001].WORKTYPE="Chrome Mask") , [jb-2001].NET, 0 )) AS Glass2,
[customer], [name]
FROM [jb-2001];
So, how can i use [customer] and [name] in the details section of the report, because at the moment i get the 'not part of aggregate function' error?
Hoping someone can shed some light ! Thanks in advance...
I'm getting the 'not part of aggregate function' error on a SQl. After looking through previous posts, i can see that it's because i'm grouping some of my fields (using SUM) but not others. The trouble i have, is i don't understand what i have to do with them in the SQL.
I have a report which has a few fields in the header that calculate some sum values. Further down the report, i then want to list these individually in the 'details' section of the report, grouped by [worktype].
Here is the simplified version of the code...
SELECT
Sum (IIf (([jb-2001].WORKTYPE="Chrome Mask") , [jb-2001].NET, 0 )) AS Glass1,
Sum (IIf (([jb-2001].WORKTYPE="Chrome Mask") , [jb-2001].NET, 0 )) AS Glass2,
[customer], [name]
FROM [jb-2001];
So, how can i use [customer] and [name] in the details section of the report, because at the moment i get the 'not part of aggregate function' error?
Hoping someone can shed some light ! Thanks in advance...