SQL code to pad leading zeros and get last 3 months varchar
<p>I need SQL code to pad leading zeros and get last 3 months as varchar. Sample code below. My syntax is not right.</p>

<pre><code>select RIGHT('00' + CONVERT(NVARCHAR(2), datepart(mm, dateadd(mm, -3, getdate())), 2) 
</code></pre>

<p>result I am after:   02</p>