Ver Mensaje Individual
  #31  
Antiguo 29-11-2012
Avatar de Casimiro Noteví
Casimiro Noteví Casimiro Noteví is offline
Merodeador
 
Registrado: sep 2004
Ubicación: En algún lugar.
Posts: 32.671
Reputación: 10
Casimiro Noteví Tiene un aura espectacularCasimiro Noteví Tiene un aura espectacular
He hecho una pruebecita con estos datos y funciona correctamente, creo.
Código SQL [-]
select h.nrohabitacion, h.idtipo, h.idhabitacion
from tbhabitaciones h
where h.idtipo = 1
and h.idhabitacion  in (select r.idhabitacion
                         from tbreservadas r
                         where r.fechasalida <= '01.12.2012'
                         or    r.fechaingreso >= '03.12.2012')
and h.idhabitacion  in (select o.idhabitacion
                         from tbocupadas o
                         where o.fechasalida <= '01.12.2012'
                         or    o.fechaingreso >= '03.12.2012')
order by h.nrohabitacion
Responder Con Cita