Many people on this forum would advise you that doing that type of formatting is better done at the client side, such as in the presentation layer. However, if you do need it, you need it - so you can do it as shown below:SELECT [CompanyCode], [SalesOffice],right('00000'+cast(SUM([Pages]) as varchar(32)),5) [Pages],right('00000'+cast(SUM([Records]) as varchar(32)),5) [Records] FROM [Emtex].[dbo].[ASDValidation] GROUP BY [CompanyCode], [SalesOffice]