Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > SQL
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 19-10-2004
Listirrinin Listirrinin is offline
Registrado
 
Registrado: ago 2004
Posts: 5
Poder: 0
Listirrinin Va por buen camino
UTILIZA EL CASE EN VEZ DEL IF
DE TODAS FORMAS SI EL SQL ES EL QUE PROPONES TE SUGIERO LO SIGUIENTE

CREATE PROCEDURE [DBO].[PRUEBVA2] (@tipo int)AS
SELECT tabla1.horario

FROM
SELECT *
FROM dbo.HORA
WHERE (dbo.HORA.horario <= '13' and @tipo = 0) OR (dbo.HORA.horario > '13' and @tipo<>0)
)



UTILIZACION DEL CASE....
NO LO HE PROBADO PERO YA QUE EL IF NO FUNCIONA.... PRUEBA LO SIGUIENTE:
CREATE PROCEDURE [DBO].[PRUEBVA2] (@tipo int)AS
SELECT tabla1.horario

FROM

(
CASE WHEN (@tipo = 0) THEN SELECT *
FROM dbo.HORA
WHERE (dbo.HORA.horario <= '13')
ELSE
SELECT *
FROM dbo.HORA
WHERE (dbo.HORA.horario > '13')

END
)
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 12:52:46.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi