Calculating dividend received in Microsoft Access - Stack Overflow

I am maintaining my tiny portfolio of stocks and trying to expand it further to keep the track of divid

I am maintaining my tiny portfolio of stocks and trying to expand it further to keep the track of dividend I received. I have created a query that tracks my trades and various columns of that query are as follows -

qryTrade
TradeID
AccountID
StockID
TradeDate
Quantity
Price
TradeCommission
ExtendedPrice

The quantity is positive for buying and negative for selling a security. Further, I have a table that maintains the dividend history of various stocks I hold.

tblDividend
DividendID
StockID
ExDividendDate
PayoutDate
DividendPerShare

I am trying to calculate number of shares I held for a given StockID and AccountID on the day prior to ExDividendDate indicated on tblDividend, which is essentially a sum of the Quantity column. If I sell a security on the ExDividendDate, I am still eligible for the full dividend. This summation is then multiplied with DividendPerShare column in the table tblDividend to arrive at total dividend received for the corresponding ExDividendDate.

Is there a way to calculate this? I understand that DSUM function is the right candidate here but not sure how to write this query.

Thanks, Nimish

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744263137a4565734.html

相关推荐

  • Calculating dividend received in Microsoft Access - Stack Overflow

    I am maintaining my tiny portfolio of stocks and trying to expand it further to keep the track of divid

    8天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信