>I want to add a balance field to this query how do I achive this
>
>
>select outdt as date ,packsetid, shetkariid,
>sum(inqty) as inqty, sum(outqty) as outqty , ****running balance field***
>from stkoffset
>where packsetid = @p_packsetid and shetkariid = @p_shetkariid
>group by packsetid, shetkariid, outdt
>order by packsetid, shetkariid, outdt
>
>Rajesh
select outdt as date ,packsetid, shetkariid,
sum(inqty) as inqty,
sum(outqty) as outqty ,
sum(inqty - outqty) as Balance
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.