Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Sold Qty
Message
From
26/11/2010 14:10:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Get Sold Qty
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01490599
Message ID:
01490599
Views:
102
Dear Experts

I have following data
&& opening stock table
create  cursor open_stock (dates d(8),codes c(4),products c(15),qty n(3),sold n(3),rate n(8,2),amount n(9,2))
insert into open_stock values({^2010-07-01},'1401','Hard Disk',1,0,1100,0)
replace all amount with qty*rate

&& purchase table
create  cursor purchase (dates d(8),codes c(4),products c(15),qty n(3),sold n(3),rate n(8,2),amount n(9,2))
insert into purchase values({^2010-07-01},'1401','Hard Disk',2,0,1200,0)
insert into purchase values({^2010-07-02},'1401','Hard Disk',3,0,1300,0)
insert into purchase values({^2010-07-03},'1401','Hard Disk',4,0,1400,0)
insert into purchase values({^2010-07-03},'1401','Hard Disk',8,0,1500,0)
replace all amount with qty*rate

&& sale table
create  cursor sales (dates d(8),codes c(4),products c(15),qty n(3))
insert into sales values({^2010-07-01},'1401','Hard Disk',2)
insert into sales values({^2010-07-04},'1401','Hard Disk',5)
It display following result as figure 1

----------------
Opening Qty=1
Purchased Qty=17
Total Qty=18
----------------
Sold QTY=7
----------------

Now I want to filled sold column in both dbf's (open_stock & purchase) as as figure 2

Please help
Next
Reply
Map
View

Click here to load this message in the networking platform