ASP with SQL bringing different query result

0

Good afternoon!

We are finalizing a panel that will bring the results of a SQL into an ASP page. We already have two finalized panels that are pulling the results perfectly. Only one of the panels does not return the result with the SELECT that we use, although when played in SQL SERVER it returns the correct value. Only in ASP running that does not. We tried some alternatives, but nothing. Here is the code snippet:

strSQL =          " SELECT count(solid) AS ENCERRADOS "
strSQL = strSQL & " FROM SOLICITACAO S "
strSQL = strSQL & " INNER JOIN USUARIO U ON (S.UsuIdReclamante  = U.UsuID) "
strSQL = strSQL & " INNER JOIN FilhoPai f on u.usuid = f.UsuIDFilho "
strSQL = strSQL & " INNER JOIN Usuario ux on ux.UsuID = f.UsuIDPai "
strSQL = strSQL & " INNER JOIN Usuario ur on ur.UsuID = s.UsuIDResponsavel "
strSQL = strSQL & " INNER JOIN Usuario ug on ur.usuIDGrupo = ug.usuID "
strSQL = strSQL & " WHERE SolData BETWEEN '2015-07-16 00:00:00' and '2015-07-16 23:59:59' "
strSQL = strSQL & " AND ug.usunome = 'Service Desk - 1º Nível TI' "
strSQL = strSQL & " AND s.usuidultimoresp = '2721184' "
strSQL = strSQL & " AND (SOLSTATUS IN ('7','9')) "

Set BUSCA3 = Server.CreateObject("ADODB.RecordSet")
BUSCA3.Open strSQL, Conexao, 1 

And the place where the result is displayed:

<p class="textoPainel"><%= BUSCA3("ENCERRADOS")%></p>

In the direct query in the database, the value 22 returns. In ASP it returns 0.

    
asked by anonymous 16.07.2015 / 20:16

1 answer

1

I'm getting used to PHP language, but I've already moved on classic ASP, its I remember, it was something like this:

<p class="textoPainel">
<%
if not BUSCA3.eof and not BUSCA3.bof then
    response.write(BUSCA3.fields("ENCERRADOS").value)
    BUSCA3.close
end if
%>
</p>

or

<p class="textoPainel"><%=BUSCA3.Fields("ENCERRADOS").Value; %></p>
    
22.07.2015 / 22:07