Article View: bit.listserv.sqlinfo
Article #320Re: compute sum of (colA - colB) on report
From: Richard Booker
Date: Fri, 22 Mar 2002 12:07
Date: Fri, 22 Mar 2002 12:07
56 lines
2411 bytes
2411 bytes
Thanks a lot. David Bechtel wrote: > Easy enough. What you need to do is name the calculation when it is > selected and then compute the sum on that name. > > Like: > . > . > COMPUTE SUM OF DAVE ON REPORT > . > . > SELECT > DEL_AGENCY, > SITE_NAME, > (AMT_BEFOREACCESS - ACCESS_FEE) AS DAVE > FROM BILLINGS_HEADER > > I think that you will find this as an example in the Oracle for Beginners > book. > > Good Luck, > Dave Bechtel > > Richard Booker wrote: > > > First and foremost, thanks to all of you for providing and contributing > > to such a useful resource as this newsgroup. > > > > I am trying to include on a report a grand total of the results of > > subtracting one column's value from another. > > > > Below is my best effort. Any help will be greatly appreciated. > > > > SPOOL M:\CCMIS\SQL\REPORT_OF_SUBMITTED_BILLINGS.TXT > > TTITLE 'LIST OF SUBMITTED BILLINGS' > > BREAK ON DEL_AGENCY ON REPORT SKIP 2 > > COMPUTE SUM OF (AMT_BEFOREACCESS - ACCESS_FEE) ON REPORT > > SET PAGESIZE 60 > > SET LINESIZE 150 > > SET NEWPAGE 2 > > SELECT > > DEL_AGENCY, > > SITE_NAME, > > AMT_BEFOREACCESS - ACCESS_FEE > > FROM BILLINGS_HEADER > > WHERE MONTH = '02' AND YEAR = '2002' AND SUBMIT_FLAG = 'Y' > > ORDER BY DEL_AGENCY; > > CLEAR COLUMNS > > CLEAR BREAKS > > CLEAR COMPUTES > > TTITLE OFF > > SPOOL OFF > > > > Thanks again.
Technical Details
Message-ID:
<3C9B1E74.AEB73FBC@21stcentury.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mailReferences:
<3C992B8F.1C7D21F3@21stcentury.net> <3C9AA1DB.488B2F58@attbi.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11355a,6f14565cb3057b1b X-Google-Attributes: gid11355a,public X-Google-ArrivalTime: 2002-03-22 04:10:05 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!feed2.news.rcn.net!feed1.news.rcn.net!rcn!not-for-mail From: Richard Booker <rbooker@21stcentury.net> Newsgroups: bit.listserv.sqlinfo Subject: Re: compute sum of (colA - colB) on report Date: Fri, 22 Mar 2002 06:07:16 -0600 Lines: 57 Message-ID: <3C9B1E74.AEB73FBC@21stcentury.net> References: <3C992B8F.1C7D21F3@21stcentury.net> <3C9AA1DB.488B2F58@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: UmFuZG9tSVYb6L3qBDATvfMrypRnqHPKqf1IITKZKFzNyI5QWVpuPJ5yOXdpeW05 X-Complaints-To: abuse@rcn.com NNTP-Posting-Date: 22 Mar 2002 12:09:50 GMT To: David Bechtel <davidbechtel@attbi.com> X-Mailer: Mozilla 4.5 [en]C-CCK-MCD compaq (Win98; U) X-Accept-Language: en