If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-13-10, 06:57
deeparavi deeparavi is offline
Registered User
 
Join Date: Jul 2010
Posts: 6
DB2 query

can someone help in writing a query to convert a numeric value (right aligned) to alphanumeric value (left aligned)?

e.g. (- means space)

numeric value --------1800 à alphanumeric 1800--------

numeric value ------312206 à alphanumeric 312206------

numeric value --------2206 à alphanumeric 2206--------
Reply With Quote
  #2 (permalink)  
Old 07-13-10, 08:05
dav1mo dav1mo is offline
Registered User
 
Join Date: Dec 2007
Location: Richmond, VA
Posts: 782
strip(digits(numeric_col),L,'0')
Dave
Reply With Quote
  #3 (permalink)  
Old 07-13-10, 09:38
Lenny77 Lenny77 is offline
Registered User
 
Join Date: Jul 2009
Location: NY
Posts: 886
varchar(numeric_col) --- same result.

Lenny
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On