Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total the qty
Message
 
 
To
23/07/2009 17:39:58
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
01414084
Message ID:
01414087
Views:
54
Sure. First use a temp table (or cursor) to load your text file, then do

(to create a cursor you may do - select * from myOrder where 1 = 0 into cursor curTempStocks readwrite)

insert into myOrder select StockID, SUM(amount) as TotalAmount from curTempStocks group by StockID

>I receive the order in text file:
>
>
>3001     10
>3002      5
>3001      6
>3002      4
>
>
>I append them to the table:
>
>
>use myorder
>append from "order.txt" sdf
>
>
>then I get:
>
>
>StockId  Qty
>------- ----
>3001     10
>3002      5
>3001      6
>3002      4
>
>
>while I wish the same StockId will be total together:
>
>
>StockId  Qty
>------- ----
>3001     16
>3002      9
>
>
>is there any easy way to do it?
>
>thanks for the help
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform