-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
  • 732,580
  • 175
  • 1,330
  • 1,459
Bilal
  • 19
  • 5

1 Answers1

0
SELECT RIGHT('000' + CONVERT(VARCHAR,COUNT(*)),3)
FROM Table
Giannis Paraskevopoulos
  • 18,261
  • 1
  • 49
  • 69