colin
Nov 22nd, 2000, 10:46 AM
Hi all,
I am trying to run a query to find all dates in a given period using 2 DTPickers. I can manage ok when only using 1 DTPicker but I can't seem to get it using the BETWEEN method. Here is a the piece of code I am trying:
Dim fd As Date
Dim ld As Date
Dim wt As String
fd = DTPicker1.Value
ld = DTPicker2.Value
wt = cmbWatch.Text
rsAllDates.Open "SELECT * FROM Staff_Dets
WHERE Date_From BETWEEN('" & fd & "' And '" & ld & "')
AND Location_Code = '" & lc & "'"
Cheers
I am trying to run a query to find all dates in a given period using 2 DTPickers. I can manage ok when only using 1 DTPicker but I can't seem to get it using the BETWEEN method. Here is a the piece of code I am trying:
Dim fd As Date
Dim ld As Date
Dim wt As String
fd = DTPicker1.Value
ld = DTPicker2.Value
wt = cmbWatch.Text
rsAllDates.Open "SELECT * FROM Staff_Dets
WHERE Date_From BETWEEN('" & fd & "' And '" & ld & "')
AND Location_Code = '" & lc & "'"
Cheers