Report Out put [message #206212] |
Wed, 29 November 2006 03:42 |
kamran.it
Messages: 265 Registered: September 2005 Location: Karachi
|
Senior Member |
|
|
I used this code in formula column and result is :
YarnCode Mqty Cons Net
100001 1200 50 600
100001 2200 70 1540
but I want total of both rows like:
YarnCode Net
100001 2140
I could not understand how it will be solved.
Please help.
Select sub1.yarn_code, sum(sub3.rmqty) mqty, SUB5.CONS, sub3.rmqty*sub5.cons/100 net from
(select y.yarn_code, y.balance Opn from yarn y group by y.yarn_code, y.balance) sub1,
(select p.ppno ppno, p.subpp subpp, p.req_date ETD, p.fabric_code, sum(s.req_kgs) RmQTY, p.b_code
from program p, sub_program s
where s.jobno = p.jobno
-- and req_date not between :dd and :dd1
group by p.ppno, p.subpp, p.b_code, p.fabric_code, req_date) sub3,
(select l.fabric_code fabric_code, sl.yarn_code yarn_code, sum(sl.cons) cons
from link l, sub_link sl
where sl.jobno= l.jobno
group by l.fabric_code, sl.yarn_code, sl.cons) sub5
where sub3.fabric_code = sub5.fabric_code (+)
and sub5.yarn_code = sub1.yarn_code (+)
and sub1.yarn_code = 100001
group by sub1.yarn_code, sub3.rmqty , sub5.cons
[Updated on: Wed, 29 November 2006 03:43] Report message to a moderator
|
|
|
|
|