I have this SQl String that has worked on other ocassions but for some reason is giving me "Error 13 Type mismatch"
I have checked the database to make sure all variables i am handing in are same as database .. any clues?
Dim LastDay As Date
Dim FirstDay As Date
Dim rsAdmin As Recordset
MyYear = Right(Year(Date), 2)
MyName = "Tester"
LastDay = "01/" & cboMonth.Text + 1 & "/" & cboYear.Text
LastDay = Format(DateAdd("d", -1, LastDay), "dd/mm/yy"
FirstDay = "01/" & cboMonth.Text & "/" & MyYear
SQL = "Select * " _
& "FROM tblAdminDetails " _
& "Where tblAdminDetails.[CRA] = '" & myName & "'" _
& " AND tblAdminDetails.[Date1] BETWEEN #" & FirstDay & "# and #" & LastDay & "#"
Set rsAdmin = DbsNew.OpenRecordset(SQL, dbOpenDynaset)
Thanks for any help,
Joanne
I have checked the database to make sure all variables i am handing in are same as database .. any clues?
Dim LastDay As Date
Dim FirstDay As Date
Dim rsAdmin As Recordset
MyYear = Right(Year(Date), 2)
MyName = "Tester"
LastDay = "01/" & cboMonth.Text + 1 & "/" & cboYear.Text
LastDay = Format(DateAdd("d", -1, LastDay), "dd/mm/yy"
FirstDay = "01/" & cboMonth.Text & "/" & MyYear
SQL = "Select * " _
& "FROM tblAdminDetails " _
& "Where tblAdminDetails.[CRA] = '" & myName & "'" _
& " AND tblAdminDetails.[Date1] BETWEEN #" & FirstDay & "# and #" & LastDay & "#"
Set rsAdmin = DbsNew.OpenRecordset(SQL, dbOpenDynaset)
Thanks for any help,
Joanne