Jump to content
Fórum Script Brasil
  • 0
Sign in to follow this  
reinercz

Ajuda num SELECT SUM

Question

Tenho o select abaixo de uma base de dados FIREBIRD

"SELECT SUM(VALORTOTAL) AS SOMA FROM VENDAS WHERE REPRESENTANTE='"&codvend&"' WHERE DATA='07/08/2013'"

com a instrução WHERE DATA='07/08/2013'

ele não retorna nada, mas existe dado

se eu tirar a instrução, ele retorna a somatória certa, porém quero filtrar por datas.

Alguém ai poderia ajudar?

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

tenta assim:

SELECT
     SUM(VALORTOTAL) AS SOMA
FROM
     VENDAS
WHERE
     REPRESENTANTE = 1
     AND DATA between '2013-08-07 00:00:00' and '2013-08-07 23:59:59'

Share this post


Link to post
Share on other sites
  • 0

o formato de datas do firebird é dd.mm.aaaa

Share this post


Link to post
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.

Sign in to follow this  



  • Forum Statistics

    • Total Topics
      148402
    • Total Posts
      643804
×
×
  • Create New...