Can anyone help me filter my Access database query based on the month in a Date/Time recordset?
Here's what I've tried:
Database Record "AgreeDate":
Date/Time format. i.e. 1/9/2007
1) Tried filtering the recordset:
Dim ApplicationsRS
Query = "SELECT ID, JobID, AgreeDate, Active, Hired FROM JobApplications"
Set ApplicationsRS = Connect.Execute(Query)
ApplicationsRS.Filter = MonthName(Month(ApplicationsRS("AgreeDate"))) = "January"
Filter Results:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
default_month.asp, line 35
2) Tried filtering in the initial query:
Dim ApplicationsRS
Query = "SELECT ID, JobID, AgreeDate, Active, Hired FROM JobApplications WHERE MonthName(Month(AgreeDate)) = January"
Set ApplicationsRS = Connect.Execute(Query)
Query Results:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'MonthName' in expression.
default_month.asp, line 31
Bookmarks