A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

splits investment transaction



 
 
Thread Tools Display Modes
  #1  
Old December 30th, 2009, 10:08 PM posted to microsoft.public.access.queries
Anne
external usenet poster
 
Posts: 445
Default splits investment transaction

I need an idea on how to split a transaction into two. I am recording
investments in stocks and bonds, and many times only part of the shares are
sold and I need to split the cost between the stock sold and the stock still
held.

For example
Teststock date 09/16/09 shares 1000 value 9616.96
needs to be split into two items
Teststock date 09/16/09 shares 500 value 4808.47
Teststock date 09/16/09 shares 500 value 4808.48

Any suggestions on how to do this?
  #2  
Old December 30th, 2009, 11:14 PM posted to microsoft.public.access.queries
Anne
external usenet poster
 
Posts: 445
Default splits investment transaction

Was remembered that I had a similiar problem before and I looked it up and I
did it by adding a table, where I add 2 lines items to the linked purchase
ID. Then I createdthe split below.

SELECT [24cboInvestmentsOpen].TransID, [24cboInvestmentsOpen].Transdate,
[24cboInvestmentsOpen].SymbolID, [24cboInvestmentsOpen].SharesPurch,
[24cboInvestmentsOpen].PurchAmount, TblSplitInv.PurchID, TblSplitInv.Count,
DCount("Count","tblSplitInv","[PurchID] =" & [TransID]) AS SplitCount,
IIf([splitcount]1,Round([sharespurch]/[splitcount],3)) AS SplitShares,
IIf([splitcount]1,Round([purchamount]/[splitcount],2)) AS SplitAmount,
[purchamount]-[splitamount] AS AmountLeft, IIf([splitamount][amountleft]
And [count]=1,[splitamount],[amountleft]) AS NewAmt1
FROM 24cboInvestmentsOpen RIGHT JOIN TblSplitInv ON
[24cboInvestmentsOpen].TransID = TblSplitInv.PurchID;

Now I just need to run a delete and update query to update the info.

"Anne" wrote:

I need an idea on how to split a transaction into two. I am recording
investments in stocks and bonds, and many times only part of the shares are
sold and I need to split the cost between the stock sold and the stock still
held.

For example
Teststock date 09/16/09 shares 1000 value 9616.96
needs to be split into two items
Teststock date 09/16/09 shares 500 value 4808.47
Teststock date 09/16/09 shares 500 value 4808.48

Any suggestions on how to do this?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.