Jump to content
Fórum Script Brasil
  • 0

Select


Guest --Rodrigo --
 Share

Question

Guest --Rodrigo --

Ao tentar executar selects mais complexos não dá certo existe algum meio de realiz-a-los de forma direfente?

Exemplo

"select ds_nome_cod, dt_lista, SUM(A)+SUM(P)+SUM®+SUM(S) as total, SUM(A), SUM(P), SUM®, SUM(S) from (select ds_cod_lista, dt_lista, count(case when DS_STATUS = 'A' then DS_STATUS end) A, count(case when DS_STATUS = 'P' then DS_STATUS end) P, count(case when DS_STATUS = 'R' then DS_STATUS end) R, count(case when DS_STATUS = 'S' then DS_STATUS end) S from tb_ouvidoria where dt_lista between '"&pg_data_ini&"' and '"&pg_data_fim&"' group by ds_cod_lista, dt_lista, ds_status) tudo join boffice_ebt.tb_decode_cod_nome on tudo.ds_cod_lista = boffice_ebt.tb_decode_cod_nome.ds_cod_lista group by ds_nome_cod, dt_lista order by ds_nome_cod, dt_lista"

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
Guest --Rodrigo --

Não aparece erro, na hora que valido a variavel tabela entra na condição de tabela.Eof = true

if tabela.Eof then %>

<p align="center"><font face="Verdana" size="1" color="#FF0066"><b>Não existem dados para base de dados neste período</b></font></p>

<%

tabela.close

else

do while not tabela.eof %>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Forum Statistics

    • Total Topics
      151k
    • Total Posts
      649.1k
×
×
  • Create New...