rem Name: activity.sql Type: start file report rem Written by: G. Koch rem rem Description: Report on G. B. Talbot sales by product rem during second half of 1901. set headsep ! ttitle 'Sales by Product During 1901!Second Six Months (Jul-Dec)' btitle 'from G. B. Talbot"s Ledger' column Item heading 'What Was!Sold' column Item format a18 column Item truncated column Person heading 'To Whom Sold' format a18 word_wrapped column Rate format 90.99 column ActionDate heading 'Date' column QuantityType heading 'Type' format a8 truncated column Quantity heading 'Quan' format 9990 column Ext format 990.99 break on Item skip 2 compute sum of Ext on Item set linesize 79 set pagesize 50 set newpage 0 spool activity.lst select ActionDate, Person, Item, Quantity, QuantityType, Rate, Quantity * Rate "Ext" from Ledger where Action = 'SOLD' /* last 6 months only */ and ActionDate BETWEEN TO_DATE('01-JUL-1901','DD-MON-YYYY') AND TO_DATE('31-DEC-1901','DD-MON-YYYY') order by Item, ActionDate; spool off