• You probably need a date table for this, which for example stores all the dates between 2000 and 2050.

    An example on how to generate such a table can be found here:

    Script to Populate Date Dimension, without Using a Cursor

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP