Solved

how can i convert a numeric field to a character field using as400 query

Posted on 2008-10-26
3
1,198 Views
Last Modified: 2013-12-06
I would like to know how to convert an numeric field to a character fiels using AS400 Query on an i5 OS
0
Comment
Question by:louva
  • 2
3 Comments
 
LVL 12

Expert Comment

by:jazzIIIlove
ID: 22808026
Hi there;

You have to use the DIGITS function to convert numeric to character first.
Then you can use SUBSTR if you like...

substr(digits(blabla, 2, 3))

Best regards...
0
 
LVL 12

Accepted Solution

by:
jazzIIIlove earned 500 total points
ID: 22808033
Of course:

You can't substring numerics. Convert it to a character first; then substring that result.

Best regards...

0
 
LVL 18

Expert Comment

by:daveslash
ID: 22813247

If you're using SQL (which is generally WAY easier and more powerful), then you can simply use the CHAR or VARCHAR functions.

e.g.

select char(aNumeric)
from   deleteme
;
 
HTH,
DaveSlash

Open in new window

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now