August 26, 2020 at 6:48 pm
I would like to get the sum of "Transaction Cost" as created from the multiplication of TxQty and AvgCostOld.
Any help would be appreciated.
SELECT Item, TxQty, AvgCostOld, TxQty*AvgCostOld AS TransactionCost, TxNumber, TxDate
FROM tblimInvTxHistory
WHERE TxDate > '2020-08-25'
AND TxCode = 'ADJ'
August 26, 2020 at 6:52 pm
If you are going to SUM over a collection of rows, you need to define the grouping to SUM over.
All rows? By item? By date?
August 26, 2020 at 7:00 pm
Like this?
SELECT SUM(TxQty*AvgCostOld) AS TotalTransactionCost
FROM tblimInvTxHistory
WHERE TxDate > '2020-08-25'
AND TxCode = 'ADJ'
August 26, 2020 at 7:00 pm
PS, that's not a row, it's a column 🙂
August 26, 2020 at 7:11 pm
Yes! That will do nicely. Thank you very much for your time.
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply