Running Sum - Tracking
- From: "Jackson via AccessMonster.com" <u11192@uwe>
- Date: Wed, 13 Sep 2006 10:00:24 GMT
Hi,
I've got trades that are sorted by ID in a query. The query keeps a running
sum of the cummulative quantity bought and sold. When this cummulative total
gets to zero, it means the position was closed at that point. What I want to
do is add the IDs of the trades that made it go to Closed to a new table...
Thus if I have:
ID TradeDate Ticker B/S Qty Cummulative
4306 01/08/06 XPU6 B 4 4
5328 10/08/06 XPU6 S -4 0
5488 19/08/06 XPU6 B 6 6
Basically, in the above, I've gone from Long 4 to Closed out with Trade IDs
4306 and 5328. What I want to do is somehow track those IDs as having been
closed out, I could then append these numbers to a 'closed out' table which
can then be used to filter these off future open position queries.
Does anyone have any ideas/suggestions as to how I could do this?
Any help/thoughts appreciated.
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200609/1
.
- Prev by Date: Re: compress and repair in code
- Next by Date: Re: Show file dialog box
- Previous by thread: Oralce and VB6
- Next by thread: Re: Show file dialog box
- Index(es):
Relevant Pages
|