-
Hi all,
How do i use the Compute statement as in the following example:
(I'm trying to sum up the total bill of all those Vendor who are in the same dept, AR is my table name)
Code:
Select dept, Vendor, TotalBill From AR Group By Dept Order By Dept Compute Sum(TotalBill)
I know this format is wrong somewhere, as in compute should come first or did i miss out any command ? Hope someone can correct me.
Thks a lot.
-
Your statement will only give the summary for all the data (grand total), once you get rid of the group by that is. In order to have dept totals as well, you need to do:
Code:
Select dept, Vendor, TotalBill
From AR
Order By Dept
Compute Sum(TotalBill) by dept
Compute Sum(TotalBill)
[This message has been edited by JHausmann (edited 09-17-1999).]
-