My SQL statement in source data of my
VB^ report data environment works well to extract records between #05/30/2011# and #06/05/2011# in American format.
SELECT WBTkt, DLNo, DDate, DTimeIN,DTimeOUT, RegNo, EAmount
FROM WBBasE WHERE DDate BETWEEN #05/30/2011# AND #06/05/2011#
ORDER BY DDate, DTimeOUT
My problem is when I use a variable or input textbox name from the form (frmRpWBT), which calls the report I get, "Data type mismatch in criteria expression." Where am I going wrong?
Dim vrStDt as Date, vrEdDt as Date
-------------
vrStDt = CDATE(txtStDt.Text)
vrEdDt = CDATE(txtEdDt.Text)
---------
All my SQL alternative statements give the same error;
WHERE DDate BETWEEN ' & # & vrStDt & # & ' AND ' & # & vrEdDt & # & '
or WHERE DDate BETWEEN ' & # & Forms!frmRpWBT!txtStDt & # & ' AND ' & # & Forms!frmRpWBT!txtEdDt & # & '
Please assist?