<% kSel = CLng(request.querystring("sl")) Select Case kSel Case 1 selo ="Arte & Música" logo ="img1.jpg" Case 2 selo ="Editora Landmark" logo ="img2.jpg" Case 3 selo ="Landmark Digital" logo ="img3.jpg" End Select If request.querystring("a") = "" Then ano2 = DatePart("yyyy",Now()) Else ano2 = request.querystring("a") End If Function ZeroData(dLab) aa = DatePart("yyyy",t) aL = Right(aa,2) ml = DatePart("m",t) ml = Right(("0" & ml),2) dl = DatePart("d",t) dl = Right(("0" & dl),2) hl = DatePart("h",t) hl = Right(("0" & hl),2) nl = DatePart("n",t) nl = Right(("0" & nl),2) sl = DatePart("s",t) sl = Right(("0" & sl),2) vDat = dL & "/" & mL & "/" & aL dLab = dL & "/" & mL & "/" & aa hLab = hL & ":" & nL End Function %>
<% set conn = server.createobject("adodb.connection") conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& _ Server.MapPath ("../../Dados/arquetipo.mdb")&";Persist Security Info=False" SQL = "SELECT * FROM news WHERE NW_shw=1 AND (NW_sel=" & kSel & " OR NW_sel=0) ORDER BY NW_dat DESC, NW_man ASC" SET rs = conn.execute(SQL) x = 0 While not rs.EOF t = rs("NW_dat") Call ZeroData(dLab) ano1 = DatePart("yyyy",dLab) If CLng(ano1) = CLng(ano2) Then x = x +1 %>

<%=dLab%>) " target="news-interno"><%=rs("NW_man")%>

<% End If rs.MoveNext Wend rs.close Set rs=Nothing If x = 0 Then SQL = "SELECT TOP 12 * FROM news WHERE NW_shw=1 AND (NW_sel=" & kSel & " OR NW_sel=0) ORDER BY NW_dat DESC, NW_man ASC" SET rs = conn.execute(SQL) While not rs.EOF t = rs("NW_dat") Call ZeroData(dLab) ano1 = DatePart("yyyy",dLab) If CLng(ano1) = CLng(ano2 - 1) Then x = x +1 %>

<%=dLab%>) " target="news-interno"><%=rs("NW_man")%>

<% End If rs.MoveNext Wend If x = 0 Then %>


Estamos atualizando as notícias para este Ano

<% End If End If conn.close Set rs=Nothing %>