>I want the stock report which is consist on two table
>purchase and sales.
>but not with coding use SQL
>on in four to five line coding for this report
>
>Report Format:
>
>Item Stock Report
>
>Item Name : Foxpro CD Version 7.00
>
>Doc # Date Receipt Qty issue Qty Balance Qty
>
>Opening Qty 2
>___________________________________________________________
>110 01/01/02 5 7
>112 02/02/02 3 4
>113 04/02/02 2 6
>__________________________________________________________
>Total 7 3 4
>__________________________________________________________
>
>
>
>Receipt qty will be bring from purchase table and issue qty will be from sales table
>
>Please use the SQL Command.
Roughly :
select st.ItemName, st.ItemKey, ;
nvl(pr.transno, nvl(rc.transno, sl.transno)) as 'transno' ;
nvl(rc.qty,0) as rcptqty, ;
nvl(pr.qty,0) as purchqty, ;
nvl(sl.qty,0) as salesqty ;
from stock st ;
left join purchase pr on st.ItemKey = pr.ItemKey ;
left join receipt rc on st.ItemKey = rc.ItemKey ;
left join sales sl on st.ItemKey = sl.ItemKey ;
order by st.ItemName, TransNo ;
into cursor crsReport
Cetin