> When I try either suggestion I get a "SQL:GROUP BY clause is missing ot invalid.
>
>
>
> >
> >
select account, max(adress) as address, ;
> > sum(item1) as item1, ;
> > sum(item2) as item1, ;
> > sum(total) as total ;
> > from myTable ;
> > group by 1
> >
> > Cetin Basoz
>
>
>
> Ryan J. Lashway
>
http://www.lashtech.comTry this (based on your sample):
Create Cursor junk (acctno c(10), address c(1), item1 N(1),item2 N(1), Total N(2))
Insert Into junk Values ("7077","a",5,0,5)
Insert Into junk Values ("7077","a",0,5,5)
Insert Into junk Values ("7075","a",3,5,5)
Insert Into junk Values ("7075","a",0,6,5)
Insert Into junk Values ("7077","a",4,5,5)
Select acctno, address, Cast(Sum(item1) As N(12,2)) As item1,;
CAST(Sum(item2) As N(12,2)) As item2,;
CAST(Sum(Total) As N(12,2)) As Total;
FROM junk Group By acctno, address
Maybe there are more fields than the one you showed above, try adding some of those fields in the group by clause.
Jun Tangunan
http://weblogs.foxite.com/sandstorm36/