Hi All

I have the following SQL.It's working fine...but the prob is that
no where in report i have give to compute Grand total (i have give
that name for explnation)

My Q's are

1)How to find from where that Grand Total calculating and printing.

2)I want to display the name 'Grand Total',How to do that.

3)I want to remove *** above the total...

So please give me all ur suggestions ASAP

------------------------------------------------------------------------------------------------------------
column ml new_value ML noprint
column st format A5 heading "St"
column I format A4 heading "Per"
column sold format 9,999,999 heading "Sold#"
column L format 9,999,999 heading "L$"
column B format 9,999,999 heading "B$"
column cst format 9,999,999 heading "Cst$"
column unts format 9,999,999 heading "Unts#"
column C format 9,999,999 heading "C$"
column M format 9,999,999 heading "M$"

compute sum LABEL 'Total' of sold on st
compute sum LABEL 'Total' of L on st
compute SUM LABEL 'Total' of B on st
compute sum LABEL 'Total' of cst on st
compute sum LABEL 'Total' of unts on st
compute sum LABEL 'Total' of C on st
compute sum LABEL 'Total' of M on st


break on ML skip page on st skip 1

Select st
'1' ML
(CASE
WHEN trunc(to_date('&datethru') - to_Date('&datefrom')) < 8 THEN to_char(Dt, 'D')
WHEN ceil(months_between('&datethru' , '&datefrom')) < = 1 THEN 'Wk'|| to_char(Dt, 'W')
WHEN ceil(months_between('&datethru' , '&datefrom')) < 4 THEN to_char(Dt, 'Mon')
ELSE 'Qtr'|| to_char(Dt, 'Q')
END) I,
nvl(sum(sold),0) sold,
nvl(sum(L),0) L,
nvl(sum(B),0) B,
nvl(sum(cst),0) cst,
nvl(sum(unts),0) unts,
nvl(sum(C),0) C,
nvl(sum(M),0) M
FROM Mytab
WHERE '&MODE' = 'S'
GROUP BY st,
(CASE
WHEN trunc(to_date('&datethru') - to_Date('&datefrom')) < 8 THEN to_char(Dt, 'D')
WHEN ceil(months_between('&datethru' , '&datefrom')) < = 1 THEN 'Wk'|| to_char(Dt, 'W')
WHEN ceil(months_between('&datethru' , '&datefrom')) < 4 THEN to_char(Dt, 'Mon')
ELSE 'Qtr'|| to_char(Dt, 'Q')
END)
ORDER BY st,
(CASE
WHEN trunc(to_date('&datethru') - to_Date('&datefrom')) < 8 THEN to_char(Dt, 'D')
WHEN ceil(months_between('&datethru' , '&datefrom')) < = 1 THEN 'Wk'|| to_char(Dt, 'W')
WHEN ceil(months_between('&datethru' , '&datefrom')) < 4 THEN to_char(Dt, 'Mon')
ELSE 'Qtr'|| to_char(Dt, 'Q')
END);

St Per Sold# L$ B$ Cst$ Unts# C$ M$
----- ---- ---------- ---------- ---------- ---------- ---------- ---------- ----------
02 Wk1 0 0 0 0 0 0 0
Wk2 0 0 0 0 0 0 0
Wk3 0 0 0 0 0 0 0
Wk4 0 0 0 0 0 0 0
Wk5 0 0 0 0 0 0 0
***** ---------- ---------- ---------- ---------- ---------- ---------- ----------
Total 0 0 0 0 0 0 0

03 Wk1 0 0 0 0 0 0 0
Wk2 0 0 0 0 0 0 0
Wk3 0 0 0 0 0 0 0
Wk4 0 0 0 0 0 0 0
Wk5 0 0 0 0 0 0 0
***** ---------- ---------- ---------- ---------- ---------- ---------- ----------
Total 0 0 0 0 0 0 0

***** ---------- ---------- ---------- ---------- ---------- ---------- ----------
04 Wk1 0 0 0 0 0 0 0
Wk2 0 0 0 0 0 0 0
Wk3 0 0 0 0 0 0 0
Wk4 0 0 0 0 0 0 0
Wk5 0 0 0 0 0 0 0
***** ---------- ---------- ---------- ---------- ---------- ---------- ----------
Total 0 0 0 0 0 0 0

---------- ---------- ---------- ---------- ---------- ---------- ----------
Grand Total 0 0 0 0 0 0 0





========================

Thanks