Dear All,
Kindly suggest me how to get cumulative qty in Dispatch , credit and stock qty and how to set date parameter in report.if it is not possible in query report suggest me how to do in crystal report.please see the below scenario of my report .
for ex:if i select sep month 30th date.i need cumulative qty from sep1st to 30thsep or if i select sep29th i need cumulative qty from 1st sep to 29th sep or if i select 5th oct i need cumulative qty from 1st oct to 5th oct.
select distinct t0.itemcode,t0.ItemName,e.[ Credit],d.Dispatch ,c.[Open order] as 'Open Order',b.OnHand as 'Stock',a.OnHand as 'Second',t0.MinLevel,t0.MaxLevel
from OITM t0 inner join OITW t1 on t0.ItemCode=t1.ItemCode inner join
(select ItemCode,OnHand,WhsCode from OITW where WhsCode='SECWH' and ItemCode like 'FFP%%')a on a.ItemCode=t0.ItemCode inner join
(select ItemCode,OnHand,WhsCode from OITW where WhsCode='fgwh' and ItemCode like 'FFP%%')b on b.ItemCode=t0.ItemCode left join
(Select itemcode,WhsCode,sum(OpenQty)as 'Open order' from RDR1 where WhsCode='fgwh' and ItemCode like 'FFP%%' group by itemcode,WhsCode ) c on
c.ItemCode=t0.ItemCode left join
(select ItemCode,WhsCode,sum(Quantity) as 'Dispatch' from INV1 where WhsCode='fgwh' and ItemCode like 'FFP%%' group by itemcode,WhsCode)d on
d.ItemCode=t0.ItemCode left join(select t0.ItemCode,t0.WhsCode,sum(t0.Quantity) as ' Credit' from IGN1 t0 where t0.ItemCode like 'FFP%%' and t0.WhsCode='gwh' group by t0.ItemCode,t0.WhsCode )e on e.ItemCode=t0.ItemCode
where t1.ItemCode like 'FFP%%'and t1.WhsCode='FGWH'
--group by t0.itemcode,t0.ItemName,t0.MinLevel,t0.MaxLevel,a.OnHand,b.OnHand