Anyone!
How does the date criteria work for the DSum function?? I can't get it to Sum using the following methods. Thanks in advance.
First Method:
sSQL1 = "[ReturnDate] = #" & Format(Text31, "dd/mm/yyyy") & "#"
nRevenue = DSum("[LateCharge]", "tblHireTransaction", sSQL1)
Second Method:
sSQL1 = "[ReturnDate] = #" & Format(Text31, "dd/mm/yy") & "#"
nRevenue = DSum("[LateCharge]", "tblHireTransaction", sSQL1)
[ReturnDate] is of Date/Time data type. Text31 is an unbound field on my form with format "short date" and default "=Date()".
How does the date criteria work for the DSum function?? I can't get it to Sum using the following methods. Thanks in advance.
First Method:
sSQL1 = "[ReturnDate] = #" & Format(Text31, "dd/mm/yyyy") & "#"
nRevenue = DSum("[LateCharge]", "tblHireTransaction", sSQL1)
Second Method:
sSQL1 = "[ReturnDate] = #" & Format(Text31, "dd/mm/yy") & "#"
nRevenue = DSum("[LateCharge]", "tblHireTransaction", sSQL1)
[ReturnDate] is of Date/Time data type. Text31 is an unbound field on my form with format "short date" and default "=Date()".