GROUP BY a number of DAY in SQL Server I have this query 

    SELECT  dbo.f_DateWithoutHour (0,DATEADD (DAY, 3, TheDate)) AS Date
    FROM (
        SELECT TheDate 
        FROM xxxxxxx.dbo.dim_date (NOLOCK)
        WHERE  TheDate &gt;= '2019-02-09 00:00:00' AND TheDate &lt; '2019-04-07 00:00:00'
    ) AS dim_date
    GROUP BY dbo.f_DateWithoutHour (0,DATEADD (DAY,  3, dim_date.TheDate))
    ORDER BY Date


which return this



But the thing is that i want to GROUP BY every 3 days so i get in return

       DATE
2019-02-12 00:00:00.000
2019-02-15 00:00:00.000
2019-02-18 00:00:00.000
2019-02-21 00:00:00.000
2019-02-24 00:00:00.000
          .
          .


Thanks
Add to your WHERE clause: AND DATEDIFF(DAY,'2019-02-09',TheDate) % 3 = 0

This will evaluate the number of days between your initial date and the current value of TheDate. The modulus (%) operator will return 0 for every 3 days in the timeline. Note that performance may take a hit evaluating this expression for every row, depending on the number of members in the dimension.