Display leading zeros in numeric field 
Author Message
 Display leading zeros in numeric field
Is it possible to display leading zeros in numeric field or I have to use
char field?  My users want to use numeric datatype, not char and it cannot
display leading zeros.  The is a OS/390 DB2.

Thanks in advance.

Fred



Sat, 23 Jun 2001 03:00:00 GMT
 Display leading zeros in numeric field



Quote:
>Is it possible to display leading zeros in numeric field or I have to use
>char field?  My users want to use numeric datatype, not char and it cannot
>display leading zeros.  The is a OS/390 DB2.

>Thanks in advance.

>Fred

Fred, the DIGITS() function returns the character representation of a
numeric column, including leading zeros. You can use this function in
your code, or create views that contain DIGITS() functions so your
users and coders don't have to bother.  Read more about DIGITS() in
the DB2 reference manual.

Lee

The Crayfish
-------------------------------------------------
Visit Crayfish World! http://www.thecrayfish.com/

Remove the Spam-proofing capital letters from my
e-mail address to send me mail.

Fight Spam! Join CAUCE! === http://www.cauce.org/
Outlaw Junk Email! Support HR 1748.



Sun, 24 Jun 2001 03:00:00 GMT
 Display leading zeros in numeric field
You could use the scalar function DIGITS to get the leading zeros to
display.  Do something like this:
        SELECT DIGITS(SOMENUMBER) FROM....

Duane

Quote:
        -----Original Message-----

        Posted At:      Tuesday, January 05, 1999 9:24 AM
        Posted To:      ibm-db2
        Conversation:   Display leading zeros in numeric field
        Subject:        Display leading zeros in numeric field

        Is it possible to display leading zeros in numeric field or I
have to use
        char field?  My users want to use numeric datatype, not char and
it cannot
        display leading zeros.  The is a OS/390 DB2.

        Thanks in advance.

        Fred



Sun, 24 Jun 2001 03:00:00 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. leading zeros and right justified in numeric field

2. Leading zeros lost in NUMERIC columns when using FOR XML

3. Leading zeroes in numeric to char conversion

4. TSQL - Display leading zero

5. Display leading zero

6. How to import an display Short-Date to include leading zero

7. Forms 4.5: How to store/display leading zeros?

8. Truncate Leading Zeros on varchar field

9. Transact SQL Scripting-Removing leading zeros from an alphanumeric field (RE-SENT BECAUSE OF AN ERROR)

10. Transact SQL Scripting-Removing leading zeros from an alphanumeric field

11. fixed length of numeric field using zero's

12. Text field in Excel returns null when led by a zero


 
Powered by phpBB® Forum Software