Teutonic_Night Posted August 14, 2007 Posted August 14, 2007 Does anyone know of a way to serially increment text? For example, if a field contains the value of "A", incrementing it would result in "B". A value of "B" would increment to "C", etc. I haven't found any built-in text functions to handle this, and would like to avoid having a table to store replacement values.
LelandLong Posted August 14, 2007 Posted August 14, 2007 What increments the field: script, another field? What happens when you reach 'Z', start over at 'A'?
Teutonic_Night Posted August 15, 2007 Author Posted August 15, 2007 It would increment via script. It is not expected that it would need to increment beyond "Z". Since I needed to get something done pretty quickly, I ended up using a related table to store replacement values. IE: the original table only stores a number, but the related table has an alpha value for each number. Not the most elegant solution, but it works. I'd still ike to know if there's a way to increment text via script, though.
sbg2 Posted August 15, 2007 Posted August 15, 2007 Use a serial number field like normal and a calculation for the "Serail Text" MySerialText = Middle ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" ; MySerialNUMBER;1)
dreamingmind Posted August 15, 2007 Posted August 15, 2007 and you could get away from the use of a serial field if you use the position() function to find where your current letter is in the string of letters then just get the letter from the next position. Don
Vaughan Posted August 15, 2007 Posted August 15, 2007 "It is not expected that it would need to increment beyond "Z"." Famous last words. I'd be working out now what to do when this condition eventuates.
sbg2 Posted August 16, 2007 Posted August 16, 2007 "It is not expected that it would need to increment beyond "Z"." Famous last words. I'd be working out now what to do when this condition eventuates. http://fmforums.com/forum/showpost.php?post/244248/
Vaughan Posted August 16, 2007 Posted August 16, 2007 Base 26 conversion would be the ultimate solution! Yes.
Recommended Posts
This topic is 6369 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now