Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) Erro com Datas!


Vagner Nunes

Pergunta

Prezados,

Bom dia. Estou aqui mais vez, preciso da ajuda dos senhores, tenho uma página aqui comigo de uma faculdade que é feito a inserção no banco de Boletins Informativos da biblioteca, porém os meses de Dezembro nunca aparece.

Alguém pode me ajudar?

Segue código abaixo:

<%@ Language=VBScript %>

<!--#include file="includes/conexao.asp" -->
<!--#include file="includes/estilos.asp" -->

<%

    'PEGA TODOS OS USUARIOS PARA MOSTRAR
    set rstaquisicoes = server.CreateObject ("adodb.recordset")
    rstaquisicoes.Open "SELECT distinct nu_ano FROM aquis ORDER BY nu_ano",conexao,adOpenForwardOnlyy

    'rstaquis.Open "SELECT * FROM aquis ORDER BY year(dt_data) DESC" & sWhere ,conexao,adOpenForwardOnlyy


%>

<HTML><HEAD>
<TITLE>Biblioteca</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>


<BODY BGCOLOR=#F1F1F1 LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<a name="topo"></a>

<div align="center">
  <center>
  
<!--#include file="includes/topo.asp" -->

<table width="0" border="0">
  <tr>
    <th scope="col"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="777" height="23">
      <param name="movie" value="includes/menutopo.swf">
      <param name="quality" value="high">
      <embed src="includes/menutopo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="777" height="23"></embed>
    </object></th>
  </tr>
</table>
<TABLE WIDTH=777 BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="White">
    <TR>
        <TD valign="top" align="center">
        
            <TABLE WIDTH=95% BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="White">
                <TR>
                    <TD height= "400" valign="top" align="left">
                        
                        <BR>
                        <IMG src="images\seta_maior.jpg" align=absmiddle>&nbsp;<font class="textogeraltitulo">BOLETIM INFORMATIVO</font>
                        <BR><BR>
                                                

                        <%
                        if rstaquisicoes.RecordCount > 0 then
                            %>

                            <TABLE align="center" BORDER=0 CELLSPACING=0 CELLPADDING=0>
                                <TR >

                                <%
                                set rstmes = server.CreateObject ("adodb.recordset")
                                
                                ano = 0
                                do while not rstaquisicoes.EOF
                                    
                                    if ano <> rstaquisicoes("nu_ano") then

                                        %>
                                        <TD>
                                            <TABLE  BORDER=0 CELLSPACING=0 CELLPADDING=0 class="box2">
                                                <TR>
                                                    <TD height="25" bgcolor=Silver width="70" align="center" class="tdcabecalhotabela">&nbsp;<%=rstaquisicoes("nu_ano")%></TD>
                                                </TR>
                                        
                                    
                                        <%
                                    end if
                                    
                                    
                                    rstmes.Open "SELECT nu_mes, ds_arquivo FROM aquis WHERE nu_ano = " & rstaquisicoes("nu_ano") & " ORDER BY nu_mes",conexao,adOpenForwardOnlyy
                                    
                                    for mes = 1 to 12
                                        if not rstmes.EOF then
                                            if rstmes("nu_mes") = mes then
                                        
                                                data="10/"& right("00" & rstmes("nu_mes"),2)& "/2008"
                                                data = split(formatdatetime(data,vbLongDate),"de")
                                                
                                                %>
                                                
                                                <TR>
                                                    <TD class="linhabottom" height="25" align="center"><a target="_new" href="\biblioteca\<%=rstmes("ds_arquivo")%>" class="linktabela"><%=data(1)%></a></TD>
                                                </TR>
                                                <%
                                                rstmes.MoveNext 
                                            else
                                                %>
                                                <TR>
                                                    <TD  class="linhabottom" height="25" align="center">-</TD>
                                                </TR>
                                                <%
                                            end if
                                        else
                                            %>
                                            <TR>
                                                <TD class="linhabottom" height="25" align="center">-</TD>
                                            </TR>
                                            <%
                                        end if
                                        
                                    next
                                    
                                    %>
                                    
                                        
                                        </TABLE>
                                        
                                    </TD>    
                                    <%
                                    rstmes.Close
                                    
                                    ano = rstaquisicoes("nu_ano")
                                    rstaquisicoes.movenext
                                loop
                                %>
                                
                              </TD>
                                </TR>
                            </TABLE>
                            <%
                        end if
                        %>


                        </font>


                        <BR>
                    </TD>
                </TR>
                <TR>
                    <TD colspan=2>
                        <BR>
                        <center>
                        <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
                        <TR>
                            <TD width="85" height="28"  background="Images\botao_cinza.jpg" align=center valign=middle>
                                <A HREF="biblioteca.asp?menu=4" class="linkbotao">Voltar</a>
                            </TD>
                        </TR>            
                        </TABLE>
                        </center>
                        <BR><BR>            
                    </TD>
                </TR>
                
            </TABLE>
        </TD>
    </TR>
    <TR>
        <TD valign=middle align="center" WIDTH=777 HEIGHT=33 background=images/modelo_06.jpg><font face=verdana size=1 color=gray><!--#include file="includes/barra.asp" --></font></TD>
    </TR>
</TABLE>
<BR>
</BODY>
</HTML>
<%
    
    rstaquisicoes.Close
    set rstaquisicoes = nothing
    
    fechaconexao
    
%>

</BODY>
</HTML>

Sds,

Vagner Nunes

Editado por Vagner Nunes
Link para o comentário
Compartilhar em outros sites

7 respostass a esta questão

Posts Recomendados

  • 0

Tinha esqueci do end if, porém depois retirei posteriormente, e continua não aoarecendo o mês de Dez.

Na pasta do gerente, existe a seguinte estrutura.

/aquisicoes.asp (neste arquivo aparece todos os uploads do boletins e gravados no banco, o mais estranho é que todos os arquivos fica descritos certinhos, como mostro abaixo:

janeiro_2008 Vol. 8, n.61, jan 2008.pdf

Já os meses de dez fica assim:

_2008 Vol. 8, n.61, jan 2008.pdf

Todos os meses aparece certo, só o DEZ dá isso, daí verifiquei o banco, para ver se não estava gravando, porém no banco está tudo ok.

/aquisicoes_envia.asp (este arquivo faz o Upload do Boletim e gravaem banco, baixei o banco e conferir, esta gravando todos os campos certinho)

Aguardo contato,

Sds,

Vagner Nunes

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.


  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,4k
×
×
  • Criar Novo...