
18/10/2011, 10:08
|
 | Colaborador | | Fecha de Ingreso: agosto-2006 Ubicación: En la hermosa perla de occidente
Mensajes: 7.412
Antigüedad: 18 años, 6 meses Puntos: 774 | |
Respuesta: Max de fechas con 2 columnas
Código SQL:
Ver originalCREATE TABLE #temp ( id INT, año INT, mes INT ) DELETE FROM #temp INSERT INTO #temp VALUES (1,2011,10) INSERT INTO #temp VALUES (2,2011,9) SELECT * FROM #temp WHERE año=datepart(yy,getdate()) AND mes=datepart(mm,getdate())
Saludos!
__________________ What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me |