🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: bit.listserv.sqlinfo
3 messages
3 total messages Started by Richard Booker Thu, 21 Mar 2002 00:38
compute sum of (colA - colB) on report
#318
Author: Richard Booker
Date: Thu, 21 Mar 2002 00:38
29 lines
1672 bytes
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.
Re: compute sum of (colA - colB) on report
#319
Author: David Bechtel
Date: Fri, 22 Mar 2002 03:11
52 lines
2292 bytes
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.
Re: compute sum of (colA - colB) on report
#320
Author: Richard Booker
Date: Fri, 22 Mar 2002 12:07
56 lines
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.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads