If you want to get the first day of the month of a input datetime variable from a SQL Query , here’s how you do it.
SELECT DATEADD(month, DATEDIFF(month, 0, GetDate()), 0) AS StartMonthDate
Published on September 6, 2016 by Senthil Kumar
Filed under SQL Server
Last modified September 6, 2016
Print this pageIf you want to get the first day of the month of a input datetime variable from a SQL Query , here’s how you do it.
SELECT DATEADD(month, DATEDIFF(month, 0, GetDate()), 0) AS StartMonthDate
Leave a Comment