Good show, Jason, but you can simplify even more if you let DATEADD do the conversion for you. Using your good test data in the following…
IF OBJECT_ID('tempdb..#SomeDate', 'U') IS NOT NULL
DROP TABLE #SomeDate;
CREATE TABLE #SomeDate (
INSERT #SomeDate (YearMonth) VALUES
,Prev1 = CONVERT(CHAR(7),DATEADD(mm,-1,sd.YearMonth+'-01'),20)
,Prev2 = CONVERT(CHAR(7),DATEADD(mm,-2,sd.YearMonth+'-01'),20)
FROM #SomeDate sd
Now, I know what you’re thinking. Like I used to, you’re thinking that the CROSS APPLY causes the concatenation of “-01” and the explicit conversion to DATETIME to happen only once. If you look at the “Defined Values” property of the Compute Scalar node in the Actual Execution plan, you’ll see that it still does the full calculation for both values because the CROSS APPLY is actually a correlated subquery by nature.
Mine does an Implicit Cast + the concatenation. Yours does an equally expensive Explicit Cast + the concatenation. All else being the same, I’d go for the simplicity.