Here is the code
function DisplayUpcomingEvents
strSql = "SELECT event_id, start_date, event_title, PRIVATE, "
strSql = strSql & strDBNTSQLName & " FROM " & strTablePrefix & "EVENTS "
strSql = strSql & "INNER JOIN " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "ON " & strTablePrefix & "EVENTS.added_by = "
strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & "WHERE start_date < '" & DateToStr(date()) & "' "
strSql = strSql & "AND start_date > '" & DateToStr(DateAdd("d",30,date())) & "' "
strSql = strSql & "ORDER BY start_date ASC"
'Following Statement is for MySql DB Users
strSql = strSql & " LIMIT " & intDisplay & " "
%>
and
function DisplayPastEvents
strSql = "SELECT event_id, start_date, event_title, PRIVATE, "
strSql = strSql & strDBNTSQLName & " FROM " & strTablePrefix & "EVENTS "
strSql = strSql & "INNER JOIN " & strMemberTablePrefix & "MEMBERS "
strSql = strSql & "ON " & strTablePrefix & "EVENTS.added_by = "
strSql = strSql & strMemberTablePrefix & "MEMBERS.MEMBER_ID "
strSql = strSql & "WHERE start_date < '" & DateToStr(date()) & "' "
strSql = strSql & "AND start_date > '" & DateToStr(DateAdd("d",-30,date())) & "' "
strSql = strSql & "ORDER BY start_date DESC"
'Following Statement is for MySql DB Users
strSql = strSql & " LIMIT " & intDisplay & " "
%>