Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sill want to SELECT a Date...

Status
Not open for further replies.

adamsoderqvist

Programmer
Sep 8, 2001
136
SE
I placed this question a few days back, but didn't seem to get a sufficient answer...(though I appreciate the effort! :) )

I'm trying to retrieve posts in Access by todays date (as in a
guestbook).But it won't work.

This what i have:

SELECT PostDate, Subject, Message FROM tblMessages WHERE PostDate = #" & Date()& "#"

...and this is the error-msg returned:

"ADODB.Recordset error '800a0bcd'
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record."

- Yet there is a record and, as I said, it works when I retrieve by other parameters such as the actual Message body or by subject!
 

Is it possible that PostDate contains time values as well as the date as in "9/10/01 14:22:34?" If so, try the following. The Int function strips the time portion of the datetime column.

SELECT PostDate, Subject, Message
FROM tblMessages
WHERE Int(PostDate) = Date() Terry L. Broadbent
Life would be easier if I had the source code. -Anonymous
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top