Hi,
I want to be able to return a concatenated column of two integer values formatted as:
00 / 00
I can't find an easy way to format numbers as 00. There must be a better way to do this than the bloated code below:
Case
When intNumber1 > 9 Then Cast(intNumber1 as varchar(2))
Else '0' + Cast(intNumber1 as varchar(1))
End + ' / ' +
Case
When intNumber2 > 9 Then Cast(intNumber2 as varchar(2))
Else '0' + Cast(intNumber2 as varchar(1))
End
as FormattedColumn
Any ideas?
I want to be able to return a concatenated column of two integer values formatted as:
00 / 00
I can't find an easy way to format numbers as 00. There must be a better way to do this than the bloated code below:
Case
When intNumber1 > 9 Then Cast(intNumber1 as varchar(2))
Else '0' + Cast(intNumber1 as varchar(1))
End + ' / ' +
Case
When intNumber2 > 9 Then Cast(intNumber2 as varchar(2))
Else '0' + Cast(intNumber2 as varchar(1))
End
as FormattedColumn
Any ideas?