<% nMonth = request("month") if len(nMonth) < 1 then nMonth = 0 end if nYear = replace(request("year"), "#", "") if len(nYear) < 1 then nYear = 0 else if len(nYear) > 4 then nYear = left(nYear, 4) end if end if if cint(nMonth) = 0 and clng(nYear) = 0 then dtNow = now else dtNow = CheckLeadingZero(cint(nMonth)) & "/1/" & nYear end if response.write monthname(month(dtNow)) & " " & year(dtNow) %> Newsletter<% dim dtNow dim objConn dim objRs Set objConn = Server.CreateObject("ADODB.Connection") Set objRs = Server.CreateObject("ADODB.Recordset") objConn.open APPLICATION("CONNECTIONSTRING") sSQL = "select eventdate, URL, title, weblink.weblinkid, durationhours, durationminutes, id, description from weblink, weblink_pgroup " sSQL = sSQL & "where weblink.weblinkid=weblink_pgroup.weblinkid and " sSQL = sSQL & "weblink_pgroup.pgroupid=" & application("PGROUPID") sSQL = sSQL & " and eventDate >= '" & checkleadingzero(month(dtNow)) & "/" & CheckLeadingZero(day(dtNow)) & "/" & year(dtNow) & " 00:00:00' " sSQL = sSQL & " and eventDate <= '" & checkleadingzero(month(dateadd("m", 2, dtNow))) & "/" & checkleadingzero(day(dateadd("m", 2, dtNow))) & "/" & year(dateadd("m", 2, dtNow)) & " 23:59:59'" sSQL = sSQL & " order by eventdate asc" objRs.Open sSQL,objConn if objRs.EOF = false then %>
" & vbcrlf end if objRs.Close objConn.Close Set objConn = Nothing %> |