Here is my issue in greater detail. Sorry for not being more specific...I've tried Dsum, Davg, Dlookup and nothing works correctly.
I have a totals query that is I have a DSum field where I want to sum only the field in these column where the salary expense is greater than 0: GrossRev. Since I don't have PersonnelExp for every account listing, it's skewing the true personnel expense as a percent of gross revenue. (I have other fields that I need to sum all the values in the column regardless of zero values)
Totals Query:
GrossRev: DSum("[GrossRevenue]","**Single account ","[Salary/BenefitExp] > 0")
The Totals Query is pulling from another query where I have filtered based on two parameters from a form where I can select the data between two years to give me the results.
**Single Account query:
Between [forms]![frmSingleAcctGraph]![Year 1] And [forms]![frmSingleAcctGraph]![Year2]
The DSum field is not producing the correct calculations.
Attached is a sample db.
When you open frmSingleAcctGraph and select just one year, you get the right GrossRev amount - 94985997 (which is the last column). It's when I select both years 2007 and 2008 from form and the last GrossRev column simply sums the the two years together and repeats the same total for each - 148930091.
The **Graph Output Single account query isn't recognizing the filter from on the **Single account query which is Between [forms]![frmSingleAcctGraph]![Year 1] And [forms]![frmSingleAcctGraph]![Year2]