SQL Generate Date from given date range



 WITH Dates AS (  
     SELECT  
      [Date] = CONVERT(DATETIME,'1-1-2017')  
     UNION ALL SELECT  
      [Date] = DATEADD(DAY, 1, [Date])  
     FROM  
      Dates  
     WHERE  
      Date < '12-31-2017'  
 ) SELECT [Date]  
 FROM Dates  
 OPTION (MAXRECURSION 1000)  



Popular posts from this blog

WPF Crystal Report Viewer Using SAP

mvc razor textboxfor change event change another textboxfor value

ASP.NET MVC razor SAP Crystal report