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 & "#")
> Hello all,
>
[quoted text clipped - 4 lines]
> vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", "[dtimemod] between
> vSDate and vEDate")
Tim Ferguson - 15 Dec 2005 18:09 GMT
> vSQL = DSum("[qty_picked]", "VIAWARE_AFRM_TO_VIA_T", & _
> "[dtimemod] between #" & vSDate & "# and #" & vEDate & "#")
This is, of course, not safe for the rest of the world that does not use
USAian dates.
Tim F