Ver Mensaje Individual
  #8  
Antiguo 03-03-2004
pruz pruz is offline
Miembro
 
Registrado: sep 2003
Posts: 170
Reputación: 21
pruz Va por buen camino
Aqui va el codigo

ROMAN,
te adjunto el codigo

Select ast.id_persona as Codigo, pr.str_nombre as nombre, ab.*, ast.*, srv.*, sum(srv.can_hrs_utilizado) as tot_horas from tb_sgj_asunto ast, tb_sgj_servicio srv
join tb_sgj_persona pr on ast.id_persona = pr.id_persona
join tb_sgj_abogado ab on srv.idf_abo_realizado = ab.id_persona
Where srv.fec_realizacion >= '2003-12-01'
and srv.fec_realizacion <= '2003-12-31'
and ast.id_persona in (1,2,3,4,5,6,7,8,9,12,15,16,25,56,89,86,88,79,54)
and ast.idf_asunto = srv.idf_asunto
and srv.idf_abo_realizado in (100,101,102,105,105)
group by nombre, srv.idf_asunto
Order by nombre

//hasta aqui funciona bien
//luego agrege lo siguiente

union
select sum(hrspendientes) from base2.horas
Where base2.horas.fec_realizacion >= '2003-12-01'
and base2.horas.fec_realizacion <= '2003-12-31'
and base2.clientes in (1,2,3,4,5,6,7,8,9,12,15,16,25,56,89,86,88,79,54)
group by clientes
Order by clientes

Nota: en la BASE2 existe clientes que hay en la BASE1. como podran editarse estos?
Responder Con Cita