我需要从表中总计一笔金额。如果没有记录,我的函数必须返回零,但事实并非如此。我得到'#Error'。这是我的功能:
Public Function Fees() As Double
Fees = Nz(DSum("MyFee", "tblDisclosure", "Volunteer = True And Not IsNull(ReceiptsLookup) and RequestDate> DateSerial(Year (Date),Month (Date),1)-1"), 0)
End Function
答案 0 :(得分:0)
尝试使用正确的标准字符串:
Public Function Fees() As Double
Fees = Nz(DSum("MyFee", "tblDisclosure", "Volunteer = True And Not IsNull(ReceiptsLookup) And RequestDate > DateSerial(Year(Date()), Month(Date()), 0)"), 0)
End Function