~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Phillip Ruminski" <phillipruminski@e...>
Subject: [access_asp] Re: Filter Recordset Based on Date Greater Than
Another Date
: I'm getting the same error message as Eric but I need to filter for
: specific records in a recordset. A SELECT query would be inefficient for
: my needs.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Can you explain why? The below seem ideal for placing in the WHERE clause of
an SQL statement. ADO doesn't really do anything magic - most of the time is
just issues SQL statements behind the scenes to get you the results you
want...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Here's my filter and the problem is with the date comparison in
: the last AND.
:
: rst2Clone.Filter = "EmployeeID = " & strEmployeeID _
: & " AND RecordDate = " & strRecordDate _
: & " AND TeamID = " & strTeamID _
: & " AND [DispatchTime] = " & datDispatch
:
: The data type for both DispatchTime and datDispatch is Date/Time and the
: actual date in both variable is "6/8/2002 11:32:25 AM" (without the
: quotes, of course). Can anybody help. Thanks.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Access uses # to delimit dates. Also, I suggest you use ISO date format
(yyyy/mm/dd hh:mm:ss) to query for particular dates. Additional
information/instructions on the .Filter property can be found here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/
mdprofilter.asp?frame=true
Cheers
Ken