MIDRANGE dot COM Mailing List Archive



MIDRANGE-L » February 2010

Using SQL to obtain a 6 character field from a 3, 4, 5 or 6 character string




Good morning all
what I am trying to achieve sounds so familiar. I believe this was a
discussion that happened a couple of years ago, but I cannot seem to find
it.
Probably searching for the wrong thing

Anyway, heres my dilemma
I have a file with a 10 character field (lets call it FIELDA)
Within this FIELDA, I can have a 3, 4, 5, or 6 character string (not
necessarily left adjusted)
This string happens to be numeric (but for my purposes - it needs to remain
alpha)
I need to convert this numeric string into a 6 character string with
leading zeroes
AND
I need to create a view/index over this file using this new field as the
key

It being Monday morning, not having my 18th cup of coffee, bleary eyed from
staying up too long after the super bowl etc. etc.
I just cannot get my head around this, therefore, as always, any and all
help would be MUCH appreciated

Thanks in advance


Alan Shore
Programmer/Analyst, Direct Response
E:ashore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill





Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2012 by MIDRANGE dot 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 here. If you have questions about this, please contact