Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How query the SQL statement by the output is leading 0

Status
Not open for further replies.

EngJoo

Programmer
May 14, 2002
90
0
0
MY
Greeting,

i face a difficulties on query the output in leading 0.

for example:

my customer number =1234

for instant i declare customer char(10)

then i wish my query output is 0000001234(leading Zero)

Does anyone can provide me the SQL Script on how to do that?

Thank you.
 
Don't know what your query looks like, but you could try this ...

select RIGHT('0000000000' + CustomerField,10) AS 'Customer'

I was standing in the park, wondering why frisbees got bigger as they came closer... then it hit me!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top