I have a stored procedure that has to accept a month as int (1-12) and a year as int. Given those two values, I have to determine the date range of that month. So I need a d
You can use DATEFROMPARTS to declare the first day of the month and EOMONTH to derive the last date of the month from the first date.
DECLARE @Month INT = 1
DECLARE @Year INT = 2020
DECLARE @FromDate DATE = DATEFROMPARTS(@Year, @Month, 1)
DECLARE @ToDate DATE = EOMONTH(@FromDate)
SELECT @FromDate MonthFirstDate, @ToDate MonthLastDate