You can get the first of the current month as follows:
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
If you add one month to the above result, you will receive the first of the following month:
DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
Using these two dates, you can get the required strings as follows:
SELECT
…
FROM table1
WHERE date >= DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) , 0)
AND date < DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
source
share