• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 337
  • Last Modified:

Convert Integer into a fix Char column

Dear Experts,

How can I convert an Integer Column into a fix Char Column like as follows:

Integer Column                         Char (7) Column
7    -----                                   0000007
8                                             0000008
9                                             0000009
10                                           0000010
100                                         0000100
1000                                       0001000

Any lead will be greatly apprciated.

Thanks.


0
JaimeJegonia
Asked:
JaimeJegonia
  • 2
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT RIGHT('0000000'+CAST(urIntColumn as varchar),7)
0
 
JaimeJegoniaAuthor Commented:
That's right. I've been trying to settle it using Char(7) and LEFT function.

Thanks you saved me hours.
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
thanks for Grade 'B'
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now