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

Erro Na Consulta


shelter

Pergunta

Fala galera, na boa ...

stou precisando de vc,s

Tenho uma consulta que agrupa e COUNT duas tabelas, relacionas ( agrupadas pelo mesmo como de valores iguas ).

Tabela Tabela Count

1 2

Ramal 101 Ramal 101 5

Ramal 103 Ramal 103 3

Ramal 104 Ramal 104 ( Não possui o Ramal 104 )

Então no caso de dar que no ramal 104 é = ( 0 ) , ela me dar o seguinte erro

Tipo de erro:

ADODB.Field (0x80020009)

BOF ou EOF são verdadeiros, ou o registro atual foi excluído. A operação solicitada pelo aplicativo requer um registro atual.

Valeu hein Galera Fuiiiiiiii

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

Segue Código

strSQL2 = " Select Ramal , COUNT ( * )  AS totalEf "
strSQL2 = strSQL2 & " From  Ramal , CRJJ04 "
strSQL2 = strSql2 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL2 = strSQL2 & " And grupo Like '%" & Setor & "%'  And servico = 1 "
strSQL2 = strSQL2 & " GROUP BY Ramal "
strSQL2 = strSQL2 & " ORDER BY 1 Asc " 
Set rsCRJJ0421 = conexaodb.Execute(strSQL2)


strSQL3 = " Select Ramal , COUNT ( * )  AS totalEf1 "
strSQL3 = strSQL3 & " From  Ramal , CRJJ04 "
strSQL3 = strSql3 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL3 = strSQL3 & " And grupo Like '%" & Setor & "%'  And servico = 2 "
strSQL3 = strSQL3 & " GROUP BY Ramal "
strSQL3 = strSQL3 & " ORDER BY 1 Asc " 
Set rsCRJJ0422 = conexaodb.Execute(strSQL3)


strSQL4 = " Select Ramal , COUNT ( * )  AS totalEf2 "
strSQL4 = strSQL4 & " From  Ramal , CRJJ04 "
strSQL4 = strSql4 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL4 = strSQL4 & " And grupo Like '%" & Setor & "%'  And servico = 3 And 4 "
strSQL4 = strSQL4 & " GROUP BY Ramal "
strSQL4 = strSQL4 & " ORDER BY 1 Asc " 
Set rsCRJJ0423 = conexaodb.Execute(strSQL4)


strSQL5 = " Select Ramal , COUNT ( * )  AS totalEf3 "
strSQL5 = strSQL5 & " From  Ramal , CRJJ04 "
strSQL5 = strSql5 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL5 = strSQL5 & " And grupo Like '%" & Setor & "%'  And servico = 5 And 6 And 7 "
strSQL5 = strSQL5 & " GROUP BY Ramal "
strSQL5 = strSQL5 & " ORDER BY 1 Asc " 
Set rsCRJJ0424 = conexaodb.Execute(strSQL5)

strSQL6 = " Select Ramal , COUNT ( * )  AS totalEf4 "
strSQL6 = strSQL6 & " From  Ramal , CRJJ04 "
strSQL6 = strSql6 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL6 = strSQL6 & " And grupo Like '%" & Setor & "%'  And Tipo = 0 "
strSQL6 = strSQL6 & " GROUP BY Ramal "
strSQL6 = strSQL6 & " ORDER BY 1 Asc " 
Set rsCRJJ0425 = conexaodb.Execute(strSQL6)

strSQL7 = " Select Ramal , COUNT ( * )  AS totalEf5 "
strSQL7 = strSQL7 & " From  Ramal , CRJJ04 "
strSQL7 = strSql7 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL7 = strSQL7 & " And grupo Like '%" & Setor & "%'  And Tipo = 1 "
strSQL7 = strSQL7 & " GROUP BY Ramal "
strSQL7 = strSQL7 & " ORDER BY 1 Asc " 
Set rsCRJJ0426 = conexaodb.Execute(strSQL7)

strSQL8 = " Select '%" & Setor & "%', COUNT ( * )  AS totalEf6 "
strSQL8 = strSQL8 & " From  Ramal , CRJJ04 "
strSQL8 = strSql8 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL8 = strSQL8 & " And grupo Like '%" & Setor & "%'  And Tipo = 0 "
strSQL8 = strSQL8 & " GROUP BY Ramal.grupo "
strSQL8 = strSQL8 & " ORDER BY 1 Asc " 
Set rsCRJJ0427 = conexaodb.Execute(strSQL8)

strSQL9 = " Select '%" & Setor & "%', COUNT ( * )  AS totalEf7 "
strSQL9 = strSQL9 & " From  Ramal , CRJJ04 "
strSQL9 = strSql9 & " WHERE Ramal.Ramal=CRJJ04.Origem  "
strSQL9 = strSQL9 & " And grupo Like '%" & Setor & "%'  And Tipo = 1 "
strSQL9 = strSQL9 & " GROUP BY Ramal.grupo "
strSQL9 = strSQL9 & " ORDER BY 1 Asc " 
Set rsCRJJ0428 = conexaodb.Execute(strSQL9)

%>

<html>
<head>
<title>Setor</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<!--
body,td,th {
	font-family: Tahoma;
	font-size: 11px;
	color: #000000;
}
.style1 {color: #FFFFFF}
body {
	margin-left: 50px;
}
-->
</style></head>
<body>

<table width="735" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td width="109">&nbsp;</td>
    <td width="521"><div align="right"></div></td>
    <td width="95"><div align="right"></div></td>
  </tr>
</table>
<table width="701" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td width="58">Setor:</td>
    <td width="107"><% = Response.Write("Setor") %></td>
    <td width="84">Total efetuadas: </td>
    <td width="69"><% = rsCRJJ0427 ( "totalEf6" ) %></td>
    <td width="80">Total recebidas:</td>
    <td width="70"><% = rsCRJJ0428( "totalEf7" ) %></td>
    <td width="70"><a href="Sumario_mes_mes2.asp"><img src="Figuras/bot_voltar2.gif" alt="Voltar" width="50" height="8" border="0"></a></td>
    <td width="72"><a href="javascript:Self:print()"><img src="Figuras/btn_imprimir.gif" alt="Imprimir Documento" width="72" height="22" border="0"></a></td>
    <td width="63"><div align="right"></div></td>
  </tr>
</table>
<table width="701" border="0">
  <tr>
    <td width="695" height="23"><hr align="left" width="600" color="#000000"></td>
  </tr>
</table>
<table width="706" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td width="48" bgcolor="#003366"><div align="center"><span class="style1">Ramal</span></div></td>
    <td width="76" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es locais</span></div></td>
    <td width="93" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es regionais </span></div></td>
    <td width="77" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es DDD </span></div></td>
    <td width="84" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es Celular</span></div></td>
    <td width="81" bgcolor="#003366"><span class="style1">Total efetuadas</span></td>
    <td width="87" bgcolor="#003366"><div align="center"><span class="style1">Total recebidas </span></div></td>
    <td width="135">&nbsp;</td>
  </tr>
</table>
<%
DO UNTIL rsCRJJ0421.EOF

%>


<table border="0" cellpadding="1" cellspacing="1" width="708">
<tr>
  <td width="51" > 
      <div align="center">
        <% = rsCRJJ0421.fields( "Ramal" ) %>
        </div></td>
    
    <td width="75" > 
                  <div align="center">
                    <% = rsCRJJ0421("totalEf") %> 
             </div></td>
     
          <td width="93" ><div align="center">
               <% = rsCRJJ0422( "totalEf1" ) %>
             </div></td>
                <td width="75" ><div align="center">
                  <% = rsCRJJ0423( "totalEf2" ) %>
                </div></td>
                <td width="85" ><div align="center">
                  <% = rsCRJJ0424( "totalEf3" ) %>
                </div></td>
                <td width="79" ><div align="center">
                  <% = rsCRJJ0425( "totalEf4" ) %>
                </div></td>
                <td width="89" ><div align="center">
                  <% = rsCRJJ0426( "totalEf5" ) %>
                </div></td>
           <td width="136" > 
             <div align="center">        </div></td>
     
     
  </tr>
</table>


  <%
'rsCRJJ042.MoveNext

rsCRJJ0421.MoveNext
rsCRJJ0422.MoveNext
rsCRJJ0423.MoveNext
rsCRJJ0424.MoveNext
rsCRJJ0425.MoveNext
rsCRJJ0426.MoveNext

Loop
'RsCRJJ042.close
RsCRJJ0421.close

'Set RsCRJJ042 = nothing
Set RsCRJJ0421 = nothing
%>
  

</p>
</p>
<table width="600" border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td height="23"><hr align="left" width="600" color="#000000"></td>
  </tr>
</table>

<p>&nbsp;</p>

</body>
</html>

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

  • 0

você tem certeza q todos os recordsets terao o mesmo numero de registros?

porque você usa o rsCRJJ0421 e vai ate o final do arquivo.

se o rsCRJJ0421 tiver mais registros q o rsCRJJ0422 por exemplo, o rsCRJJ0422 já vai ter mostrado todos os registros q possui e vai estar em no final do arquivo (EOF) enquanto você vai ainda estar lendo o rsCRJJ0421. então você vai passar deonov pelo rsCRJJ0422 e tentar mostrar um campo q não tem valor, pois o arquivo esta em EOF, por isso o erro.

o q c pode fazer é testar se ta em EOF antes. tipo:

<td width="79" ><div align="center">
<% If Not rsCRJJ0425.EOF Then
         Response.Write rsCRJJ0425( "totalEf4" )
End If %>
</div></td>

Link para o comentário
Compartilhar em outros sites

  • 0

Olha o erro....

Tipo de erro:

ADODB.Field (0x80020009)

BOF ou EOF são verdadeiros, ou o registro atual foi excluído. A operação solicitada pelo aplicativo requer um registro atual

Link para o comentário
Compartilhar em outros sites

  • 0

O que você pode fazer é uma verificação, conforme o colega acima disse, mas para o COUNT, desta forma:

if IsNull(rsCRJJ0422("totalEf1")) or totalEf1 = "" then
rsCRJJ0422("totalEf1") = 0
end if

Assim você atribui um valor caso esteja nulo ou vazio o contador.

Quanto o que eu disse antes, da brincadeira.. é que tem muito SQL, acho que você podia fazer uma function...

Link para o comentário
Compartilhar em outros sites

  • 0

Andreia fiz deste jeito:

<td width="75" >

<div align="center" class="style7">

<% if IsNull(rsCRJJ0421("totalEf")) or totalEf = "" then

rsCRJJ0421("totalEf") = 0

Response.Write rsCRJJ0421("totalEf")

end if

%>

</div></td>

e deu o seguinte erro:

Tipo de erro:

ADODB.Recordset (0x800A0CB3)

O conjunto de registros atual não oferece suporte para atualização. Isso pode ser uma limitação do provedor ou do tipo de bloqueio selecionado.

/teste2/teste_query.asp, line 169

Link para o comentário
Compartilhar em outros sites

  • 0

Cade o tipo do ponteiro na abertura do recordset ??

acho q é isso mesmo o problema.

você esta mexendo alguma coisa na propriedade CursorLocation da Conexao ou do RecordSet?

poste pra gente ver, o codigo de quando c abre a conexao, quando c abre os record set e mostra tb qual é essa linha 169.

Link para o comentário
Compartilhar em outros sites

  • 0

<%

Sub AbreConexao

const cntCaminho = "C:\inetpub\wwwroot\tarifador.mdb"

Set conexaodb = Server.CreateObject ("ADODB.connection")

conexaodb.open "driver={Microsoft Access Driver (*.mdb)}; dbq=" & cntCaminho

End sub

Sub FechaConexao

conexaodb.close

set conexaodb = nothing

end sub

%>

Link para o comentário
Compartilhar em outros sites

  • 0

Aqui vo te postar o codigo a partir para parte que alterei

<td width="85" ><div align="center" class="style7">

<% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then Response.Write 0

Else

Response.Write rsCRJJ0424("totalEF3")

end if %>

</div></td>

<td width="75" >

<div align="center" class="style7">

</div></td>

<td width="79" ><div align="center" class="style7">

<% If Not rsCRJJ0425.EOF Then Response.Write rsCRJJ0425( "totalEf4" ) end if %>

</div></td>

<td width="89" ><div align="center" class="style7">

<% If Not rsCRJJ0426.EOF Then Response.Write rsCRJJ0426( "totalEf5" ) end if %>

</div></td>

<td width="136" >

<div align="center"><span class="style7">

</span> </div></td>

</tr>

</table>

<%

'rsCRJJ042.MoveNext

rsCRJJ0421.MoveNext

rsCRJJ0422.MoveNext

rsCRJJ0423.MoveNext

rsCRJJ0424.MoveNext

rsCRJJ0425.MoveNext

rsCRJJ0426.MoveNext

Loop

'RsCRJJ042.close

'RsCRJJ0421.close

'Set RsCRJJ042 = nothing

'Set RsCRJJ0421 = nothing

%>

<table width="701" border="0">

<tr>

<td width="695" height="23">

<hr align="left" width="600" color="#000000" size="1"></td>

</tr>

</table>

<p>Ligações do setor com tempo de duração superior a <strong>15 minutos:</strong></p>

<table width="550" border="0" cellspacing="1" cellpadding="1">

<tr>

<td width="100"><div align="center"><strong><u>Ramal</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Numero Discado </u></strong></div></td>

<td width="100"><div align="center"><strong><u>Data</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Hora</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Duração</u></strong></div></td>

</tr>

<tr>

<td width="100" height="34">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="95" size="1"> &nbsp;

<div align="center"></div></td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

</tr>

</table>

<table border="0" cellpadding="3" cellspacing="0" width="550">

<%

do while not rsCRJJ049.Eof

%>

<tr>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("origem") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("n_discado") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("Data") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.fields("Hora") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("duracao") %> Segundos

</div></td>

</tr>

<%

rsCRJJ049.MoveNext

Loop

rsCRJJ049.Close

Call fechaConexao

Set rsCRJJ049 = Nothing

%>

</table>

<table width="560" border="0">

<tr>

<td width="695" height="23">

<hr align="left" width="550" color="#000000" size="1" style="border-style: dotted; border-width: 1"></td>

</tr>

</table>

<p>&nbsp;</p>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

  • 0

assim fica meio dificil.

onde você abre o primeiro while? verifique se não deixou nenhum while aberto.

identifique tb qual é a linha 181, pois é ela q esta errada.

o q acho q pode ser tb é q o Response.Write não pode ficar na mesma linha q o if quando ouver else e end if. fica assim:

Linha 1 - <% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then
Linha 2 - Response.Write 0
Linha 3 - Else
Linha 4 - Response.Write rsCRJJ0424("totalEF3")
Linha 5 - end if %>

Link para o comentário
Compartilhar em outros sites

  • 0

Aqui fiz as alterações que me pediu, e contua dando o mesmo erro

Tipo de erro:

Erro de compilação do Microsoft VBScript (0x800A03FB)

'Loop' esperado

/teste_query.asp, line 181

Else

A linha 181 é Else

Vou te passa todo codigo

HÁ AMIGO ESTOU MUITO GRATO PELA AJUDA QUE ESTA ME DANDO, segue o código

<%

option explicit

%>

<!--#Include file="conexao2.inc"-->

<%

Dim Conexaodb , rsCRJJ04 , Setor , strSQL , rsRamal , rsCRJJ042 , strSQL2 , rsCRJJ0421 , Ramal , CRJJ04

Setor=(request.QueryString("Grupo1"))

Dim rsCRJJ0422 , strSQL3 , rsCRJJ0423 , strSQL4 , rsCRJJ0424 , strSQL5 , rsCRJJ0425 , strSQL6 , rsCRJJ0426 , strSQL7

Dim rsCRJJ0427 , strSQL8 , rsCRJJ0428 , strSQL9

Dim rsCRJJ049 , strSQL10 , totalEF

call abreConexao

strSQL = " Select grupo , as local "

strSQL = strSQl & " From ramal "

strSQL = strSQL & " where grupo like '%" & Setor & "%' "

'Set rsCRJJ042= conexaodb.Execute(strSQL)

strSQL2 = " Select Origem , COUNT ( * ) AS totalEf "

strSQL2 = strSQL2 & " From Ramal , CRJJ04 "

strSQL2 = strSql2 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL2 = strSQL2 & " And grupo Like '%" & Setor & "%' And servico = 1 "

strSQL2 = strSQL2 & " GROUP BY Origem "

strSQL2 = strSQL2 & " ORDER BY 1 Asc "

Set rsCRJJ0421 = conexaodb.Execute(strSQL2)

strSQL3 = " Select Origem , COUNT ( * ) AS totalEf1 "

strSQL3 = strSQL3 & " From Ramal , CRJJ04 "

strSQL3 = strSql3 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL3 = strSQL3 & " And grupo Like '%" & Setor & "%' And servico = 2 "

strSQL3 = strSQL3 & " GROUP BY Origem "

strSQL3 = strSQL3 & " ORDER BY 1 Asc "

Set rsCRJJ0422 = conexaodb.Execute(strSQL3)

strSQL4 = " Select Origem , COUNT ( * ) AS totalEf2 "

strSQL4 = strSQL4 & " From Ramal , CRJJ04 "

strSQL4 = strSql4 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL4 = strSQL4 & " And grupo Like '%" & Setor & "%' And servico = 3 And 4 "

strSQL4 = strSQL4 & " GROUP BY Origem "

strSQL4 = strSQL4 & " ORDER BY 1 Asc "

Set rsCRJJ0423 = conexaodb.Execute(strSQL4)

strSQL5 = " Select Origem , COUNT ( * ) AS totalEf3 "

strSQL5 = strSQL5 & " From Ramal , CRJJ04 "

strSQL5 = strSql5 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL5 = strSQL5 & " And grupo Like '%" & Setor & "%' And servico = 5 And 6 And 7 "

strSQL5 = strSQL5 & " GROUP BY Origem "

strSQL5 = strSQL5 & " ORDER BY 1 Asc "

Set rsCRJJ0424 = conexaodb.Execute(strSQL5)

strSQL6 = " Select Origem , COUNT ( * ) AS totalEf4 "

strSQL6 = strSQL6 & " From Ramal , CRJJ04 "

strSQL6 = strSql6 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL6 = strSQL6 & " And grupo Like '%" & Setor & "%' And Tipo = 0 "

strSQL6 = strSQL6 & " GROUP BY Origem "

strSQL6 = strSQL6 & " ORDER BY 1 Asc "

Set rsCRJJ0425 = conexaodb.Execute(strSQL6)

strSQL7 = " Select Origem , COUNT ( * ) AS totalEf5 "

strSQL7 = strSQL7 & " From Ramal , CRJJ04 "

strSQL7 = strSql7 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL7 = strSQL7 & " And grupo Like '%" & Setor & "%' And Tipo = 1 "

strSQL7 = strSQL7 & " GROUP BY origem "

strSQL7 = strSQL7 & " ORDER BY 1 Asc "

Set rsCRJJ0426 = conexaodb.Execute(strSQL7)

strSQL8 = " Select '%" & Setor & "%', COUNT ( * ) AS totalEf6 "

strSQL8 = strSQL8 & " From Ramal , CRJJ04 "

strSQL8 = strSql8 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL8 = strSQL8 & " And grupo Like '%" & Setor & "%' And Tipo = 0 "

strSQL8 = strSQL8 & " GROUP BY Ramal.grupo "

strSQL8 = strSQL8 & " ORDER BY 1 Asc "

Set rsCRJJ0427 = conexaodb.Execute(strSQL8)

strSQL9 = " Select '%" & Setor & "%', COUNT ( * ) AS totalEf7 "

strSQL9 = strSQL9 & " From Ramal , CRJJ04 "

strSQL9 = strSql9 & " WHERE Ramal.Ramal=CRJJ04.Origem "

strSQL9 = strSQL9 & " And grupo Like '%" & Setor & "%' And Tipo = 1 "

strSQL9 = strSQL9 & " GROUP BY Ramal.grupo "

strSQL9 = strSQL9 & " ORDER BY 1 Asc "

Set rsCRJJ0428 = conexaodb.Execute(strSQL9)

strSQL10 = " Select Top 10 * , ramal.ramal , CRJJ04.Origem , CRJJ04.duracao , CRJJ04.n_discado , CRJJ04.data "

strSQL10 = strSQL10 & " From Ramal "

strSQL10 = strSQL10 & " Inner Join CRJJ04 "

strSQL10 = strSQL10 & " On Ramal.Ramal = CRJJ04.Origem "

strSQL10 = strSQL10& " where tipo = 0 "

strSQL10 = strSQL10& " And grupo Like '%" & Setor & "%' And duracao >= 900 "

strSQL10 = strSQL10 & "Order BY origem asc "

Call abreConexao

Set rsCRJJ049 = Conexaodb.Execute(strSQL10)

%>

<html>

<head>

<title>Setor</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">

<!--

body, td, th {

font-family: Tahoma;

font-size: 11px;

color: #000000;

}

.style1 {color: #FFFFFF}

body {

margin-left: 50px;

}

.style7 {font-size: 11px}

-->

</style></head>

<body>

<table width="705" border="0" cellspacing="1" cellpadding="1">

<tr>

<td width="109">&nbsp;</td>

<td width="520"><div align="right"></div></td>

<td width="96"><div align="right"><a href="javascript:window.close()"><img src="Figuras/bot_sair%5B1%5D.gif" alt="Sair" width="39" height="13" border="0"></a></div></td>

</tr>

</table>

<table width="701" border="0" cellspacing="1" cellpadding="1">

<tr>

<td width="58">Setor:</td>

<td width="107"><% = Response.Write("Setor") %></td>

<td width="84">Total efetuadas: </td>

<td width="69"><% = rsCRJJ0427 ( "totalEf6" ) %></td>

<td width="80">Total recebidas:</td>

<td width="70"><% = rsCRJJ0428( "totalEf7" ) %></td>

<td width="70"><a href="Sumario_mes.html"><img src="Figuras/bot_voltar2.gif" alt="Voltar" width="50" height="8" border="0"></a></td>

<td width="72"><a href="javascript:Self:print()"><img src="Figuras/btn_imprimir.gif" alt="Imprimir Documento" width="72" height="22" border="0"></a></td>

<td width="63"><div align="right"></div></td>

</tr>

</table>

<table width="701" border="0">

<tr>

<td width="695" height="23"><hr align="left" width="600" color="#000000"></td>

</tr>

</table>

<table width="706" border="0" cellspacing="1" cellpadding="1">

<tr>

<td width="48" bgcolor="#003366"><div align="center"><span class="style1">Ramal</span></div></td>

<td width="76" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es locais</span></div></td>

<td width="93" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es regionais </span></div></td>

<td width="77" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es DDD </span></div></td>

<td width="84" bgcolor="#003366"><div align="center"><span class="style1">Liga&ccedil;&otilde;es Celular</span></div></td>

<td width="81" bgcolor="#003366"><span class="style1">Total efetuadas</span></td>

<td width="87" bgcolor="#003366"><div align="center"><span class="style1">Total recebidas </span></div></td>

<td width="135">&nbsp;</td>

</tr>

</table>

<%

DO UNTIL rsCRJJ0421.EOF

%>

<table border="0" cellpadding="1" cellspacing="1" width="708">

<tr>

<td width="51" >

<div align="center" class="style7">

<% = rsCRJJ0421.fields( "Origem" ) %>

</div></td>

<td width="75" >

<div align="center" class="style7">

<% If not rsCRJJ0421.EOF Then Response.Write rsCRJJ0421("totalEf") end if %>

</div></td>

<td width="93" ><div align="center" class="style7">

<% If Not rsCRJJ0422.EOF Then Response.Write rsCRJJ0422( "totalEf1" ) end if %>

</div></td>

<td width="75" ><div align="center" class="style7">

<% If Not rsCRJJ0423.EOF Then Response.Write rsCRJJ0423( "totalEf2" ) end if %>

</div></td>

<td width="85" ><div align="center" class="style7">

<% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then Response.Write 0

Else

Response.Write rsCRJJ0424("totalEF3")

end if %>

</div></td>

<

<td width="79" ><div align="center" class="style7">

<% If Not rsCRJJ0425.EOF Then Response.Write rsCRJJ0425( "totalEf4" ) end if %>

</div></td>

<td width="89" ><div align="center" class="style7">

<% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then

Response.Write 0

Else

Response.Write rsCRJJ0424("totalEF3")

end if %>

<% If Not rsCRJJ0426.EOF Then Response.Write rsCRJJ0426( "totalEf5" ) end if %>

</div></td>

<td width="136" >

<div align="center"><span class="style7">

</span> </div></td>

</tr>

</table>

<%

'rsCRJJ042.MoveNext

rsCRJJ0421.MoveNext

rsCRJJ0422.MoveNext

rsCRJJ0423.MoveNext

rsCRJJ0424.MoveNext

rsCRJJ0425.MoveNext

rsCRJJ0426.MoveNext

Loop

'RsCRJJ042.close

'RsCRJJ0421.close

'Set RsCRJJ042 = nothing

'Set RsCRJJ0421 = nothing

%>

<table width="701" border="0">

<tr>

<td width="695" height="23">

<hr align="left" width="600" color="#000000" size="1"></td>

</tr>

</table>

<p>Ligações do setor com tempo de duração superior a <strong>15 minutos:</strong></p>

<table width="550" border="0" cellspacing="1" cellpadding="1">

<tr>

<td width="100"><div align="center"><strong><u>Ramal</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Numero Discado </u></strong></div></td>

<td width="100"><div align="center"><strong><u>Data</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Hora</u></strong></div></td>

<td width="100"><div align="center"><strong><u>Duração</u></strong></div></td>

</tr>

<tr>

<td width="100" height="34">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="95" size="1"> &nbsp;

<div align="center"></div></td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

<td width="100">

<hr style="border-style: dotted; border-width: 1" color="#000000" width="80" size="1">&nbsp;</td>

</tr>

</table>

<table border="0" cellpadding="3" cellspacing="0" width="550">

<%

do while not rsCRJJ049.Eof

%>

<tr>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("origem") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("n_discado") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("Data") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.fields("Hora") %>

</div></td>

<td width="100"><div align="center" class="style7">

<% = rsCRJJ049.Fields("duracao") %> Segundos

</div></td>

</tr>

<%

rsCRJJ049.MoveNext

Loop

rsCRJJ049.Close

Call fechaConexao

Set rsCRJJ049 = Nothing

%>

</table>

<table width="560" border="0">

<tr>

<td width="695" height="23">

<hr align="left" width="550" color="#000000" size="1" style="border-style: dotted; border-width: 1"></td>

</tr>

</table>

<p>&nbsp;</p>

</body>

</html>

Link para o comentário
Compartilhar em outros sites

  • 0

Veja os comentarios em verde:

<td width="93" ><div align="center" class="style7">

<% If Not rsCRJJ0422.EOF Then Response.Write rsCRJJ0422( "totalEf1" ) end if %>

</div></td>

<td width="75" ><div align="center" class="style7">

<% If Not rsCRJJ0423.EOF Then Response.Write rsCRJJ0423( "totalEf2" ) end if %>

</div></td>

<td width="85" ><div align="center" class="style7">

<% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then Response.Write 0

Aqui você deve separar por linha assim como fez no if de baixo.

Else

Response.Write rsCRJJ0424("totalEF3")

end if %>

</div></td>

< O q é isso?

<td width="79" ><div align="center" class="style7">

<% If Not rsCRJJ0425.EOF Then Response.Write rsCRJJ0425( "totalEf4" ) end if %>

</div></td>

<td width="89" ><div align="center" class="style7">

<% If IsNull(rsCRJJ0424("TotalEf3")) or rsCRJJ0424("totalEF3") = "" Then

Response.Write 0 Esse daqui esta certinho. faca igual no de cima. se der errado me avisa.

Else

Response.Write rsCRJJ0424("totalEF3")

end if %>

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...