Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Sold Qty
Message
 
 
To
29/11/2010 11:33:35
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01490599
Message ID:
01490924
Views:
38
Tariq,

Did you see the code I sent you? And if you need it to be modified for each Code, it's easy enough as well - the idea still remains the same.

>Dear Sir,
>
>Finally I wrote your codes as
>
>
>
>&& opening stock table
>create  cursor open_stock (dates d(8),codes c(4),products c(15),qty n(3),pqty 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,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),pqty n(3),sold n(3),rate n(8,2),amount n(9,2))
>insert into purchase values({^2010-07-01},'1401','Hard Disk',2,2,0,1200,0)
>insert into purchase values({^2010-07-02},'1401','Hard Disk',3,3,0,1300,0)
>insert into purchase values({^2010-07-03},'1401','Hard Disk',4,4,0,1400,0)
>insert into purchase values({^2010-07-03},'1401','Hard Disk',8,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),sold n(4),amount n(8,2))
>insert into sales values({^2010-07-01},'1401','Hard Disk',2,0,0)
>insert into sales values({^2010-07-04},'1401','Hard Disk',5,0,0)
>
>
>SELECT open_stock
>index on  DTOS(DATEs)+Codes TAG sss
>
>Select Purchase
>INDEX ON DTOS(DATEs)+Codes TAG DATE
>
>Select Open_Stock
>INDEX ON  Substr(Dtos(Dates),1,6)+Codes TAG DATE
>
>Select Sales
>set relation to Substr(Dtos(Dates),1,6)+Codes into Open_Stock,  DTOS(DATEs)+Codes  into  Purchase
>
>SCAN
> Replace Sold With Sold +Sales.Sold in Purchase 
> Replace Sold With Sold +Sales.Sold in Open_Stock
>ENDSCAN
>
>
>SELECT purchase
>BROWSE
>
>
>But these codes do not work,
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform