• ringovski - Friday, May 4, 2018 4:45 PM

    Thanks for the reply, but how do i apply your cte's to my statement?

    The CTE is only there to provide sample data, it is the WHERE clause that does the trick.
    😎

    WHERE SD.SD_DATE >= CONVERT(DATE,GETDATE(),0)
    AND  SD.SD_DATE <  CONVERT(DATE,GETDATE() + 29,0)
    AND  (DATEDIFF(DAY,0,SD.SD_DATE) % 7) < 5