ASP page with SQL string to pull recordset based on today's date versus dates in recordset
Posted on 2006-04-12
I have a simple MS Access database that with one table that has the following fields : FileId, FileStoreID, FileStartDate, FileEndDate, FileName, FilePageNum.
I plan to use this database to display content based on the start and end dates in an ASP page...
I am currently using the following Sql string, attempting to pull a recordset based on today's date:
todaysdate = Date()
SELECT * FROM files WHERE FileStoreID = 1 AND " & todaysdate & " BETWEEN FileDateStart AND FileDateEnd ORDER BY FilePageNum
Data exists with FileDateStart values of 4/11/2006 and FileDateEnd 4/18/2006 and FileStoreID's of 1....but I'm getting this error message on the line right after opening the recordset that does a Recordset1.movefirst :
ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/kait/recipe_channel/circular1.asp, line 26
Am I not pulling the recordset correctly? Any ideas?