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!
[CODE]
<%
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>”
rsCalendar.MoveNext
Loop
rsCalendar.Close
Set rsCalendar = Nothing
%>