Help to bring Closing Balance from this SQL [message #304371] |
Wed, 05 March 2008 00:30 |
kumarvk
Messages: 214 Registered: July 2004
|
Senior Member |
|
|
Dear Experts,
select material, DTE,
max(in_stk) "IN_STK", max(adj_stk) "ADJ_STK",
max(out_stk) "OUT_STK", min(dlrs) "DLRS/RTN"
from mss_v_besco_oil group by material,dte;
From this I am getting this output is
MTL DTE IN_STK ADJ_STK OUT_STK DLRS/RTN
BESCO 01-Feb-08 800 80 299 0
BESCO 02-Feb-08 0 0 9 0
BESCO 04-Feb-08 0 0 109 0
BESCO 05-Feb-08 0 216 84.5 0
BESCO 11-Feb-08 0 0 82.5 0
BESCO 12-Feb-08 0 0 113.5 0
BESCO 13-Feb-08 0 0 91.5 0
BESCO 14-Feb-08 0 0 147 0
BESCO 20-Feb-08 1600 0 260 -800
BESCO 21-Feb-08 0 0 267.5 0
BESCO 22-Feb-08 0 0 242 0
BESCO 23-Feb-08 0 360 41.5 0
BESCO 25-Feb-08 0 0 251.5 0
BESCO 26-Feb-08 800 0 247 0
I want to get the Opening balance & Closing balance day wise by modifying the script, can you experts help me to get the required output for me.
|
|
|
|
|