|
-
Sep 16th, 1999, 03:01 PM
#1
Thread Starter
Member
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.
-
Sep 16th, 1999, 10:44 PM
#2
Frenzied Member
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).]
-
Sep 17th, 1999, 05:45 AM
#3
Thread Starter
Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|