-2

I have got a count query which counts the number of records in one column of my table. As it returns an integer value, is it possible to get 3 digit value forcefully like '001' instead of '1'?

Is this possible? How?

FYI I am using SQL Server 2008 R2

marc_s
  • 704,970
  • 168
  • 1,303
  • 1,425
Bilal
  • 19
  • 5

1 Answers1

0
SELECT RIGHT('000' + CONVERT(VARCHAR,COUNT(*)),3)
FROM Table
Giannis Paraskevopoulos
  • 17,836
  • 1
  • 48
  • 66