-
How do I add a sum to a query?
I've researched this but I haven't found anything that applies to what I want to do.
I have a stock info database and one of the tables is for transactions and contains these columns:
TrxID
ActionID (buy/sell)
StockID (link to Stocks table)
Purchase Date
Shares
SharePrice
Amount
Using the instructions contained at https://www.vertex42.com/ExcelTempla...ck-quotes.html I now have a table with stock quotes also. The transactions table may contain multiple rows for the same stock. I'd like to create a query that looks like this example for AT&T:
Stock |
Symbol |
Shares Owned |
Amount |
Current Value |
AT&T |
T |
450 |
$xxxxx |
$yyyyy |
Stock and Symbol are from another linked table
Shares Owned and Amount would be the sums of 3 transactions (in this case) worth of purchases
Current Value would be Shares Owned * Current Price. I think I can handle this if I have the total shares owned for the stock.
How do I get this sum into the query?
-
Start a new query with the stock and shares fields. Click on the Totals icon. Change Group By to Sum on the shares field. See if that returns the desired result.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules