Ver Mensaje Individual
  #9  
Antiguo 15-08-2015
kcaARLOosz kcaARLOosz is offline
Registrado
NULL
 
Registrado: ago 2015
Posts: 9
Reputación: 0
kcaARLOosz Va por buen camino
La consulta que te muestro me devuelve los registros a los que les quiero hacer el update en el campo total de la tabla drybcuenf. Eso es lo que no sé hacer, el update cumpliéndose las condiciones de la consulta.
Código SQL [-]
select
    cf.pventa,
    cf.serie,
    cf.folio,
    cf.indice,
    cf.total
from
    drybcuenf cf
join
    drybcuen c
        on cf.pventa = c.pventa
        and cf.serie = c.serie
        and cf.folio = c.folio
where
    c.suma = 0 and
    c.horacierra is null
Para ver si me entiendes mejor, sería algo como.
Código SQL [-]
update drybcuenf set total = 0 where drybcuen.suma = 0 and drybcuen.horacierra is null
Responder Con Cita