I have several databases that use the following code to exclude holidays and weekends when trying to calculate the number of days to complete something.
Function NumHolidays(Sdate, Edate) As Integer
Dim rst As Recordset, SQLText
SQLText = "Select * From Holidays Where" _
& "[Date] Between #" & Sdate & "# AND #" & Edate & "#;"
Set rst = CurrentDb.OpenRecordset(SQLText)
If rst.RecordCount = 0 Then
NumHolidays = 0
NumHolidays = rst.RecordCount
It works perfect in Access 97. In Access 2000 I get a Run-time error '13' Type mismatch. Does anyone have any ideas how I can get this to run in 2000?
Thank you. Forgive me, I don't know much about this stuff. I checked the references. In 97, Microsoft DAO 3.51 Object Library was checked. I checked that in 00, but still got the same message when I ran the query. Am I doing something wrong?