I want to calculate a total in a report. It seems to me that a DSUM field would work perfectly, but I absolutely cannot figure out the syntax.
I have a table called tblLabor with the following fields
ProjectID, LaborID, LaborDate, Total
This is working. It gives me the labor total for a specific ProjectID:
But I need to add one more criteria specifying a date range. I want [LaborDate] to be between [txtStartDate] and [txtEndDate] on my form frmReportGenerator.
I'm guessing it would be something like:
Obviously this isn't right, but this gives you the idea of what I'm trying to accomplish
I've searched and searched and tried a million different ways to write this and nothing works.
Could anyone tell me how to write this DSUM function?
I have a table called tblLabor with the following fields
ProjectID, LaborID, LaborDate, Total
This is working. It gives me the labor total for a specific ProjectID:
Code:
=DSum("Total","tblLabor","ProjectID=" & "[Reports]![rptIncomeExpense]![ProjectID]")
I'm guessing it would be something like:
Code:
=DSum("Total","tblLabor","ProjectID=" & "[Reports]![rptIncomeExpense]![ProjectID]" AND [LaborDate] between [Forms]![frmReportGenerator]![txtStartDate] and [Forms]![frmReportGenerator]![txtEndDate]
I've searched and searched and tried a million different ways to write this and nothing works.
Could anyone tell me how to write this DSUM function?