Ver Mensaje Individual
  #2  
Antiguo 27-12-2007
Avatar de jachguate
jachguate jachguate is offline
Miembro
 
Registrado: may 2003
Ubicación: Guatemala
Posts: 6.254
Reputación: 28
jachguate Va por buen camino
No entiendo bien la semántica de tu consulta... pero a mi me parece que la consulta podría funcionar así:

Código SQL [-]
select * from turnos 
where  (inicio < termino and :lahora between inicio and termino)
  or ((inicio > termino) and ((:lahora >= inicio and :lahora <= '23:59:59') or (:lahora <= termino)))

La idea es esa...

Hasta luego.

__________________
Juan Antonio Castillo Hernández (jachguate)
Guía de Estilo | Etiqueta CODE | Búsca antes de preguntar | blog de jachguate
Responder Con Cita