Hey all,
Thanks to the great advice of this board, I am moving slowly but surely towards getting my database up and running.
To refresh, it is to monitor stock, bond, options trades, and summarise accounts, stock holdings, etc.
In Canada, the law on tax loss selling is this:
1) You sell your entire stake in a particular stock, so total shares in one account = 0. Note that shares can still be held in other accounts.
2) You MUST wait 30 days before buying the stock back to get the new price as your cost basis.
3) If you do not wait 30 days, you cost basis is the price of the shares you owned previously weighted averaged with the price of the shares you just bought.
So, in order to incorporate this information, I first need to walk through each security, grouped by account, and find out when the shares go to 0. I then have to check whether or not the next transaction (which can only be a BUY) occurs 30 days later.
This information should not be stored in the database itself, BUT it needs to be available in a form and a report.
The reason I believe it needs to be available in a form is that it is information that can be acted on, so it should be apparent to the user when they are entering trades into the system. I want the user interface to be as simple as possible.
Can I even do this with a query or do I need to add some VB code to my form?
Thanks to the great advice of this board, I am moving slowly but surely towards getting my database up and running.
To refresh, it is to monitor stock, bond, options trades, and summarise accounts, stock holdings, etc.
In Canada, the law on tax loss selling is this:
1) You sell your entire stake in a particular stock, so total shares in one account = 0. Note that shares can still be held in other accounts.
2) You MUST wait 30 days before buying the stock back to get the new price as your cost basis.
3) If you do not wait 30 days, you cost basis is the price of the shares you owned previously weighted averaged with the price of the shares you just bought.
So, in order to incorporate this information, I first need to walk through each security, grouped by account, and find out when the shares go to 0. I then have to check whether or not the next transaction (which can only be a BUY) occurs 30 days later.
This information should not be stored in the database itself, BUT it needs to be available in a form and a report.
The reason I believe it needs to be available in a form is that it is information that can be acted on, so it should be apparent to the user when they are entering trades into the system. I want the user interface to be as simple as possible.
Can I even do this with a query or do I need to add some VB code to my form?