The select statement below from my understanding should work, but it’s not. The where part of the statement is my problem. It’s comparing the month of the BeginningDate field in the database to the month of a variable called strMonth. Does anybody know why this is and how to fix it. Thanks!
Set rsCalendar = Server.CreateObject(“ADODB.Recordset”)
strSelect = “SELECT TOP 3 CID, EventName FROM tblCalendar WHERE DatePart(‘m’,BeginningDate) = DatePart(‘m’,” & strMonth & “) ORDER BY BeginningDate”
rsCalendar.Open strSelect, connEdenCrest
Do Until rsCalendar.EOF
Response.Write “<li><a class=’biglinkblk’ href=’eventcalendar.asp?strCID=” & rsCalendar(“CID”) & “‘><b>” & rsCalendar(“EventName”) & “</b></a></li>”
Set rsCalendar = Nothing
Help @nbcrockett spread the word by sharing this article on Twitter...Tweet This