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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to add digits in front of a number

Status
Not open for further replies.

Neozero

MIS
Jul 7, 2000
49
US
I am trying to populate a field with a 5 digit number and when the query runs, it only puts in a 4 digit number. For instance, I want a number to show up as 01457 when the query runs the number actually shows up as 1457. What can I do to make the 0 show up to make it a 5 digit number ? Here is the actual query I am using.

Select Max( EbClock ) + 1, Max( EbClock ) + 1 from Ebase where EbClock < ‘99000’

Any suggestions would be greatly appreciated.


[sig][/sig]
 
What RDBMS are you using?
If you are using Oracle, you will not be able to store the number with the leading zeros. However, the problem is NOT how the data is stored internally - it's how you display it. For instance, you could store the value as a number, but when you want to display it, use
to_char(my_number,'00000') [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top