If you're using SQL 2012 or higher, you can use
the EOMONTH
function[
^] to get the last day in a month. Otherwise, starting from the first day in the month, adding one month and then subtracting one day will give you the same result.
SELECT
EOMONTH(Convert(date, Convert(char(4), Year) + '/' + Month + '/01')) As LastDayOfMonth
FROM
YourTable
As Sergey said, don't store date values in a string column; use
the date
type[
^] instead.