Dsum between dates

pekajo

Registered User.
Local time
Today, 12:35
Joined
Jul 25, 2011
Messages
136
Hi,
I am having issues with the DSum and tried different ways of putting it none worked. My latest is:

vIncAmt = DSum("[IncAmt]", "Income" And "[IncDate] between #06/03/2021# and #06/25/2021#")

This one gives me a Type mismatch.
Any ideas what I am doing wrong.
Thanks
 
this is the error, clearly seen (if income is your table):

DSum("[IncAmt]", "Income" And "[IncDate] between #06/03/2021# and #06/25/2021#")

should be:

DSum("[IncAmt]", "Income", "[IncDate] between #06/03/2021# and #06/25/2021#")
 
if you want to include both dates
DSum("[IncAmt]", "Income", "[IncDate] between #06/03/2021# and #06/25/2021#")

if you want to exclude both dates
DSum("[IncAmt]", "Income", "[IncDate] > #06/03/2021# and [IncDate]<#06/25/2021#")
 
Probably better to not hard code the dates. Use form field references instead.
 

Users who are viewing this thread

Back
Top Bottom