3
SELECT SUM(TAXAS) FROM DOCUMENTO
LEFT JOIN PARCELAS PARCELA IN
(PARCELA.CODE = DOCUMENTO.CODE)
WHERE PARCELAS.FATURADAS = TRUE
I’m getting a syntax error I can’t fix
3
SELECT SUM(TAXAS) FROM DOCUMENTO
LEFT JOIN PARCELAS PARCELA IN
(PARCELA.CODE = DOCUMENTO.CODE)
WHERE PARCELAS.FATURADAS = TRUE
I’m getting a syntax error I can’t fix
4
SELECT SUM(DOC.TAXAS) FROM DOCUMENTOS DOC
LEFT JOIN PARCELAS PARCELA ON
(PARCELA.CODE = DOC.CODE)
WHERE PARCELAS.FATURADAS = 1
You put IN when it should be ON and it should be 1 instead of true This Where thing I didn’t realize, so you can take Ricardo’s answer as correct
4
There are two errors in your script:
1) LEFT JOIN PARCELAS PARCELA IN
must be: LEFT JOIN PARCELAS PARCELA ON
Documentation: https://technet.microsoft.com/pt-br/library/ms187518(v=sql.105). aspx
2) WHERE PARCELAS.FATURADAS = TRUE
must be: WHERE PARCELAS.FATURADAS = 1
Campos bit
are compared with 0 (false) or 1 (true)
@Diegorafaelsouza Better write your suggestion as an additional answer.
Browser other questions tagged sql-server
You are not signed in. Login or sign up in order to post.
Thank you! I didn’t realize, what a shame..
– Fernanda Neitzke