on 02-13-2009 9:56 PM
QUISIERA SABER COMO PUEDO HACER PARA QUE ME DE EL SALDO DE UN CLIENTE ORDENADO POR FACTURA, YA TENGO EL QUERY PERO EN EL LAYOUT DE IMPRESION LO TRATE DE HACER Y NO ME DA RESULTADO. YA QUE CUANDO LO EJECUTO ME SUMA EL VALOR DE UNA FACTURA QUE TIENE VALOR PENDIENTE DE PAGAR. POR EJEMPLO
FACTURA VALOR FACTUA ABONO SALDO
1 1000 1000
COBRO 500 500
COBRO2 400 100
FACTURA 2 500 600
COBRO 500 100
ES DECIR ME SUMA EL VALOR DE LA FACTURA ANTERIOR ESTO ES EN EL CASO DE QUE ESA FACTURA NO SE ENCUENTRE CANCELADA SOLO ABONADA.
Y OTRO CASO QUISIERA SABER COMO PUEDO HACER EN EL LAYOUT DE IMPRESION PARA QUE ME COMPARE UN VALOR. POR EJ.
SI MI TOTAL DE ABONOS EN EL FIELD_237 ES 24000.00 COMO PUEDO HACER PARA QUE ME DEVUELVA UN VALOR BOOLEANO
SE QUIERE PAGAR UN BONO SI EL ABONO ES MAYOR A 20000.00 Y MENOR A 28000
HE TRATADO DE HACERLO 20000<=24000.00<28000 PERO EN LAS FORMULAS DE SAP A NIVEL DE LAYOUT NO PUEDO COMO SE TIENE QUE HACER?
GRACIAS
Edited by: Rui Pereira on Feb 23, 2009 4:52 PM
Yo lo he realizado solamente si el layout es de para una query, y la manera de hacerlo es con cursores, nunca he probado en hacer un cursor dentro de la query que se ejecuta en Business One, por lo que no se si es soportado. Aqui te muestro un pequeño ejemplo de los cursores
declare @col11 as int
declare @col2 as smallint
declare C cursor for
select Col1, Col2 from Tabla
open C
fetch next from C
into @col1, @col2
while @@fetch_status = 0
begin
update tabla
-- escribir codigo aca
set col3='update'
where col1 = @col1
and col2 =@col2
-- Avanzamos otro registro
fetch next from C
into @col1, @col2
end
--cerramos el cursor
close C
deallocate C
Exito!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.