General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only