Here is the logic which isn't working as it returns a DATETIME result. Any help would be much appreciated. I've tried to change the data type to DATETIME2 but not working.
here is the code :
DECLARE @CurrentDate DATE = '0001-01-01'
SELECT DATEADD(QQ, DATEDIFF(QQ, 0, @CurrentDate), 0) AS FirstDayOfQuarter,
DATEADD(QQ, DATEDIFF(QQ, -1, @CurrentDate), -1) AS LastDayOfQuarter,
CONVERT(VARCHAR(10), DATEADD(WEEK, DATEDIFF(WEEK, 0, DATEADD(DAY, (6-
DATEPART(DAY, @CurrentDate)), @CurrentDate)),0),120) AS FirstMondayOftheMonth