CAST(YEAR(DATEADD(dd, 1, DATEADD(mm, - 1, A.COSTMONTH + '-01')
- DAY(A.COSTMONTH + '-01'))) AS varchar) + '-' + CAST(MONTH(DATEADD(dd, 1, DATEADD(mm, - 1, A.COSTMONTH + '-01') - DAY(A.COSTMONTH + '-01')))
AS varchar)