Calculating A Sum Value On A Report In Access
I have a report that is supposed to show the Stock Value of products before and after conversion. I have the source products product code and stock value displayed on the form, now
Solution 1:
You can either use DSum or build your report query to include the calculation. I would prefer the second option. This assumes that SCID is numeric, you would need quotes for a text SCID.
=DSum("sValue","[Stock Conversion Items]","SCID=" & sSCID)
Or
SELECT r.This,r.That,s.ConvValue
FROM ReportTable r
INNER JOIN (
SELECT SCID, Sum(sValue) As ConvValue
FROM [Stock Conversion Items]
GROUPBY SCID) s
ON r.sSCID = s.SCID
The above query uses aliases r and s for the tables : ReportTable r or ReportTables As r
Post a Comment for "Calculating A Sum Value On A Report In Access"