am currently programming a report that needs to spit out all of the money paid to a specific client. The Dsum function I used was:
=DSum("CashforVisit","Financials","Financials.SSN= " & [SSN])
Which worked excellent. However, I need a way to add another criteria to the DSum function, specifically that the payments happenned in 2011. This report grabs information from table Financials, which documents every payment, the SSN of the recipient, and the date of the payment.
Values to sum: CashforVisit
Table name: Financials
Criteria1:"Financials.SSN= " & [SSN]
Criteria2: DateofVisit >= 1/1/2011
Criteria3: DateofVisit <= 12/31.2011
The following solution has been suggested, but unfortunately does not seem to work:
=DSum("CashforVisit","Financials","Financials.SSN= " & [SSN] & " AND Financials.DateofVisit Between " & DateSerial(Year(Date()),1,1) & " And " & DateSerial(Year(Date()),12,31))
This expression is in the detail field of a report.
How would I do this? I have been trying for a while, I would love some help