I have this Query in the data set . The issue is even though the format is Date when its executed in the data set it shows up as DatetimeSo instead of showing as 2016-02-01 it shows 2016-02-01 12:00:00:00 AM.Since its a parameter and not a text I don't know where can I change the format again.Please adviceQuery :With CTE1 AS(SELECT CAST(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)AS DATE) AS StartDateUNIONSELECT FORMAT(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0),'yyyy-MM-dd') AS StartDateUNIONSELECT FORMAT(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-2, 0),'yyyy-MM-dd') AS StartDateUNIONSELECT FORMAT(DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-3, 0),'yyyy-MM-dd') AS StartDate)SELECT StartDate FROM CTE1ORDER BY StartDate DESC
↧