Dsum between dates (1 Viewer)

pekajo

Registered User.
Local time
Today, 11:14
Joined
Jul 25, 2011
Messages
132
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
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:14
Joined
May 7, 2009
Messages
19,169
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#")
 

oleronesoftwares

Passionate Learner
Local time
Yesterday, 17:14
Joined
Sep 22, 2014
Messages
1,159
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#")
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 20:14
Joined
Feb 19, 2002
Messages
42,981
Probably better to not hard code the dates. Use form field references instead.
 

Users who are viewing this thread

Top Bottom