Is there a SUMPRODUCT function equivelant in SQL? SUMPRODUCT multiplies two arrays and sums the totals:
s_shares, s_price_per_share
50, 24.00
40, 18.50
30, 12.00
The SUMPRODUCT of that would be:
(50 * 24.00) + (40 * 18.50) + (30 * 12) = 1,200 + 740 + 360 = 2,300
My table is called tblStocks_details and field names are above in bold. Any ideas how to do this in SQL? I want to GROUP BY s_id, as I need to display a summary of each s_id in a recordset.



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks