Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/06/2015, 15:36
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, 8 meses
Puntos: 774
Respuesta: Calcular bimestres sql server 2008 r2

eso lo puedes hacer con un while algo como esto:


Código SQL:
Ver original
  1. DECLARE @fecha datetime
  2. DECLARE @x INT
  3. DECLARE @numero-pagos INT
  4. SET @fecha=getdate()
  5. SET @x=1
  6. SET @numero_pagos=5
  7. while @x<=@numero_pagos
  8. BEGIN
  9. SET @fecha=dateadd(dd,15,@fecha)
  10. print @fecha
  11. SET @x=@x+1
  12. END
__________________
What does an execution plan say to t-sql query? Go f**k yourself, if you are not happy with me