sql get beginning of month from current date code example
Example 1: sql server beginning of month
SELECT DATEADD(month, DATEDIFF(month, 0, @mydate), 0) AS StartOfMonth
Example 2: sql end of month
EOMONTH(start_date [, offset] );
SELECT DATEADD(month, DATEDIFF(month, 0, @mydate), 0) AS StartOfMonth
EOMONTH(start_date [, offset] );