Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/10/2011, 10:10
Avatar de Libras
Libras
Colaborador
 
Fecha de Ingreso: agosto-2006
Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 17 años, 9 meses
Puntos: 774
Respuesta: existe funcion hora para sql server en una consulta?

Código SQL:
Ver original
  1. CREATE TABLE #temp(
  2. fecha datetime
  3. )
  4.  
  5. INSERT INTO #temp VALUES (getdate()-1)
  6. INSERT INTO #temp VALUES (getdate()-2)
  7.  
  8. SELECT * FROM #temp
  9.  
  10. SELECT * FROM #temp WHERE fecha >= dateadd(hh,12,CONVERT(datetime,'2011-10-22'))

Saludos!
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me