|
Hi,them
Try the following:
Create View MySchema/MyView as
Select Repeat('0', Length(Trim(MyFld))) concat Trim(Text) as NewText,
a.*
From MyTable a;
Mit freundlichen GrÃÃen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
and keeping them!"remain
-----UrsprÃngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Alan Shore
Gesendet: Monday, 08. February 2010 14:32
An: Midrange Systems Technical Discussion
Betreff: 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
alpha)from
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
staying up too long after the super bowl etc. etc.list
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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxxlist
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
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.