
#Busca la entrada 64 del rango especificado
     SELECT sum(debito-credito) INTO val_64 FROM cgtb00004
     WHERE (fecha between fecha_inicial and fecha_final and
            ref[1,5] = "ED.64") AND (cod_aux = cod_aux and cod_sec = cod_sec 
         and num_doc = orden and status_t is null)
