Please show the entire SQL statement. It is impossible to know what you are doing by looking at the fragment. Table definition info would also help.
KCCrosser – If you are trying to ensure the month and day are 2-digits with leading zeros, the easy way is to use:
set @monthstring = right(’0′ + convert(varchar(2),month(<date>)),2)
set @daystring = right(’0′ + convert(varchar(2),day(<date>)),2)
I.e. prepend a ’0′ character on the current string, then take the rightmost two characters. For values like ’10′, this creates ’010′, then take the rightmost 2 to get ’10′. For digits 1-9, it returns ’01′ thru ’09′.