> >
> > Same error, changed code to look like
> >
> >
> > Ryan J. Lashway
> >
http://www.lashtech.com>
>
>
> * Select TOQtemp
> * Goto Top
> * Those two lines are superfluous. A SELECT SQL query opens the table in
> * the FROM * clause and reads it straight from the harddisk.
>
>
> Select field1, field2,P_ID,;
> Cast(Sum(field4) As N(12,2)) As item1,;
> CAST(Sum(field5) As N(12,2)) As item2,;
> CAST(Sum(field6) As N(12,2)) As Total;
> FROM TOQtemp ;
> Group By P_ID, field1, field2
> Browse
>
> Note
> * Select field1, field2, P_ID
> * Group By P_ID, field1, field2
> * Same columns in SELECT and GROUP BY lists.
> * The rest of the columns are all SUM() aggregations.
> * You cannot SELECT nor GROUP BY a column that is aggregated in a SUM()
>
> -Anders
Works great, but one question, how can I show fields I do not want to group by ? Main part of this is I have mulipal accounts with different account # but the same P_ID so I need one record for the reports that shows total for all those records ?
Ryan J. Lashway
http://www.lashtech.com