Total por dia
Publicado por Analia (17 intervenciones) el 24/11/2008 19:48:03
Hola !!, tengo el siguiente codigo para sacar el total por dia, pero el resultado me da siempre cero. Cual puede ser el error .
SELECT totaldia
GO bottom
IF totaldia.fecha <> DATE()
APPEND blank
REPLACE totaldia.fecha WITH DATE()
replace totaldia.facturabt WITH 0
ENDIF
SELECT facturas
SET ORDER TO tag facfec
SEEK DTOC(DATE())
IF FOUND()
DO WHILE .not. EOF()
IF facturas.iva = "Resp. No Inscri" OR facturas.iva = "Cons. Final" OR facturas.iva = "Exento"
SELECT totaldia
GO bottom
replace totaldia.facturabt with totaldia.facturabt + facturas.total
ENDIF
SELECT facturas
SKIP
ENDDO
endif
DO FORM form2
SELECT totaldia
GO bottom
IF totaldia.fecha <> DATE()
APPEND blank
REPLACE totaldia.fecha WITH DATE()
replace totaldia.facturabt WITH 0
ENDIF
SELECT facturas
SET ORDER TO tag facfec
SEEK DTOC(DATE())
IF FOUND()
DO WHILE .not. EOF()
IF facturas.iva = "Resp. No Inscri" OR facturas.iva = "Cons. Final" OR facturas.iva = "Exento"
SELECT totaldia
GO bottom
replace totaldia.facturabt with totaldia.facturabt + facturas.total
ENDIF
SELECT facturas
SKIP
ENDDO
endif
DO FORM form2
Valora esta pregunta


0