Subject | Subselect error |
---|---|
Author | malikoski |
Post date | 2005-09-05T12:15:26Z |
SELECT NV.OpFis_Codigo, SUM(NV.NF_VlrNota) as totContabil,
SUM(NVV.NF_VlrBaseICMS27) as Base27,
(SELECT SUM(NVV.NF_BaseICMSX) FROM NotasVenda_Valores NVV2
WHERE NVV2.Fil_Codigo = NVV.Fil_Codigo AND
NVV2.Ser_Codigo = NVV.Ser_Codigo AND
NVV2.NF_Numero = NVV.NF_Numero AND NVV2.NF_AliqICMSX =
17 ) AS Base17,
FROM NotasVenda NV
INNER JOIN NotasVenda_Valores NVV ON NV.Fil_Codigo =
NVV.Fil_Codigo AND NV.Ser_Codigo = NVV.Ser_Codigo
AND NV.NF_Numero =
NVV.NF_Numero)
LEFT JOIN ParametrosContabeis PC ON NV.OpFis_Codigo =
PC.OpFis_Codigo
AND NV.OrFis_Codigo =
PC.OrFis_Codigo)
WHERE NV.NF_DataLcto
BETWEEN '01/01/2005' AND '12/31/2006'
GROUP BY NV.OpFis_Codigo
In the interbase, my select worked, now doesnt´t work.
Please help.
Thanks
SUM(NVV.NF_VlrBaseICMS27) as Base27,
(SELECT SUM(NVV.NF_BaseICMSX) FROM NotasVenda_Valores NVV2
WHERE NVV2.Fil_Codigo = NVV.Fil_Codigo AND
NVV2.Ser_Codigo = NVV.Ser_Codigo AND
NVV2.NF_Numero = NVV.NF_Numero AND NVV2.NF_AliqICMSX =
17 ) AS Base17,
FROM NotasVenda NV
INNER JOIN NotasVenda_Valores NVV ON NV.Fil_Codigo =
NVV.Fil_Codigo AND NV.Ser_Codigo = NVV.Ser_Codigo
AND NV.NF_Numero =
NVV.NF_Numero)
LEFT JOIN ParametrosContabeis PC ON NV.OpFis_Codigo =
PC.OpFis_Codigo
AND NV.OrFis_Codigo =
PC.OrFis_Codigo)
WHERE NV.NF_DataLcto
BETWEEN '01/01/2005' AND '12/31/2006'
GROUP BY NV.OpFis_Codigo
In the interbase, my select worked, now doesnt´t work.
Please help.
Thanks