It is not the between that is the problem, it is that the variables you are
referencing are inside the quotes. Try this:
vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
"[dtimemod] between " & vSDate & " and " & vEDate & "")
The above syntax is if the variables vSDate and vEDate are date type
varialbes. If they are textbox values, then they have to be considered
strings and delimited with # so they will be seen as dates
vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
"[dtimemod] between #" & vSDate & "# and #" & vEDate & "#")
"Mark" wrote:
> Hello all,
>
> I need to get a sum between a date range. I am using to varibles on date to
> do this, but haven't found the correct syntax yet. What am I doing wrong?
> vSDate and vEDate are my varibles.
>
> vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", "[dtimemod] between
> vSDate and vEDate")
|