Select digits(mynumber) from........


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James Lampert
Sent: Wednesday, April 27, 2011 4:22 PM
To: Midrange Systems Technical Discussion
Subject: Another dumb SQL newbie question, this time about CASTing types

As I recall, the last time I used a CAST statement, it didn't preserve
leading zeroes.

I need to CAST a 5-digit Zoned Decimal number to a character string, as
a parameter to a UDF, called in the Select that defines a view, such
that leading zeroes are preserved. i.e.,

1001 becomes '01001'
11001 becomes '11001'
and so forth.

What's the easiest way to do this?

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.