sql Get First day and last day of week of any given day/date of the month. code example
Example: sql server beginning of month
SELECT DATEADD(month, DATEDIFF(month, 0, @mydate), 0) AS StartOfMonth
SELECT DATEADD(month, DATEDIFF(month, 0, @mydate), 0) AS StartOfMonth