Hi all,

can anyone help me with the following SQL statement pls? here's the code..

Dim strSQL As String

strSQL = "SELECT [StaffInformation].[Name], [AllLeave].[Start_Date], [AllLeave].[End_Date], [AllLeave].[LeaveType], [AllLeave].[CourseName] FROM AllLeave, StaffInformation WHERE [AllLeave].[StaffID] = [StaffInformation].[StaffID] And [AllLeave].[Start_Date] >= '" & Format(DTFrom.Value, "dd-mmm-yyyy") & "' And [AllLeave].[End_Date] <= '" & Format(DTTo.Value, "dd-mmm-yyyy") & "' ORDER BY AllLeave.Start_Date, AllLeave.End_Date, AllLeave.LeaveType"


With Rpt
If .State = adStateOpen Then
.Close
End If

.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly

.Open strSQL, DB
MsgBox .RecordCount

End With


Both DTFrom & DTTo are DTPicker component
when i tried that i got error msg

Data type mismatch in criteria expression


can anyone tell me why?

Thanks