• If you wan't for display, you can convert to string using convert.

    To remove seconds from the datetime, you can do something different.

    Either you specify the exact time to start or you can calculate it.

    SELECT DATEADD( MINUTE, DATEDIFF( MINUTE, 0, DATEADD( YEAR, -2, GETDATE())), 0)

    By the way, you can remove a CTE, I just added to show the ranges without showing all the lines.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2