Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Stock Register
Message
From
05/06/2009 21:46:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Stock Register
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01404074
Message ID:
01404074
Views:
93
Dear Experts

I have three dbf’s as follows

Master.dbf
Code------product-------qty
--1---------apple-----------2
--2---------mango---------8
--3---------orange---------4
--4---------melon----------3
--5---------potato----------1

Purchase.dbf
----Date-----Code -------qty
01/06/09-----1------------6
01/06/09-----3------------5
01/06/09-----5------------7
02/06/09-----1------------6
02/06/09-----3------------5
02/06/09-----5------------7
03/06/09-----1------------10
03/06/09-----3------------12
03/06/09-----5------------14

Sales.dbf
----Date-----Code -------qty
01/06/09-----1------------5
01/06/09-----3------------4
01/06/09-----5------------6
02/06/09-----1------------5
02/06/09-----3------------4
02/06/09-----5------------1
03/06/09-----1------------8
03/06/09-----3------------9
03/06/09-----5------------6

Now I want to get stock values for date=01/06/09 as
Master.qty+purchase.qty-sales.qty

The Result will be look like this
Code------product-------open-----purchased------Sold-------Closing
--1---------apple------------2-----------6 -------------5------------3
--2---------mango----------8-----------0 -------------0------------8
--3---------orange----------4-----------5 -------------4------------5
--4---------melon-----------3-----------0 -------------0------------3
--5---------potato-----------1-----------7 -------------6------------2

And then I want to get stock values for between(date,02/06/09,03/06/09) as

Code------product-------open-----purchased------Sold-------Closing
--1---------apple-------------3-----------16 --------------13------------6
--2---------mango-----------8-------------0 ---------------0------------8
--3---------orange-----------5-----------17--------------13------------9
--4---------melon------------3-------------0----------------0------------3
--5---------potato------------2------------21 --------------7------------16

Please help
Reply
Map
View

Click here to load this message in the networking platform