AnsweredAssumed Answered

Sum on All Records with Common Field

Question asked by TSADesign on Feb 11, 2009
Latest reply on Feb 11, 2009 by ninja


Sum on All Records with Common Field


I am trying to do a sum on all records that have a common field by matching a different field.


Where "Month" is a field that will contain a month for the year, and "Months for Report" is a drop down list with January - December values.


I have tried using an =if statement as follows:

If ( Month = Months for Report ; Sum (Sales) ; False )  


The idea here is that when a month is selected in the drop down list "Months for Report", that it would give the sum of all fields with the "Month" field equaling that value. For example, if the report contains "Sales" for January, February, or March, then if I were to select 'January' in the "Months for Report" drop down, then the sum of "Sales" for records with the value 'January' would be returned.


I can get it to return only the value for the record that is presently selected if "Month" equals 'January', but I don't know how to get it to sum all of the records whose "Month" field equals 'January'.


Any help would be appreciated,