Tenho um script montado, só que surgiu a necessidade de inserir um verificação tentei da seguinte forma só que esta dando erro
SELECT
UF,
ICMSINTSP,
IVAORIGINALSP,
IVAORIGINALDEST,
PROTOCOLO,
ICMSINTERDEST,
ICMSENTSP,
ICMSINTDEST,
((IVAORIGINALSP/100+1)*( ICMSENTSP/100-1)/(ICMSINTSP/100-1)-1)*100 as IVAAJUSTENT,
((IVAORIGINALDEST/100+1)*(ICMSINTERDEST/100-1)/(ICMSINTDEST/100-1)-1)*100 as IVAAJUSTSAIDA,
SELECIONAR,
(IF SELECIONAR = True then
SELECT [UF] & ", " & replace([IVAORIGINALSP],',' ,'.')) as SCRIPT
FROM DADOS
ORDER BY UF
SELECT
UF,
ICMSINTSP,
IVAORIGINALSP,
IVAORIGINALDEST,
PROTOCOLO,
ICMSINTERDEST,
ICMSENTSP,
ICMSINTDEST,
((IVAORIGINALSP/100+1)*( ICMSENTSP/100-1)/(ICMSINTSP/100-1)-1)*100 as IVAAJUSTENT,
((IVAORIGINALDEST/100+1)*(ICMSINTERDEST/100-1)/(ICMSINTDEST/100-1)-1)*100 as IVAAJUSTSAIDA,
SELECIONAR,
(IF SELECIONAR = True then
SELECT [UF] & ", " & replace([IVAORIGINALSP],',' ,'.')) as SCRIPT
FROM DADOS
ORDER BY UF
Última edição por brunokkk88 em 28/3/2014, 18:33, editado 1 vez(es)