Newbies tsd Posted July 13, 2004 Newbies Posted July 13, 2004 Hi ! I have a field that should look like this : A-12345-K C-98765-J G-67676-F I will only allow A-Z in first 2 character then 1-9 next 5 and at last A-Z How would i easiest solve that ? Best Regards.....
Steve T. Posted July 13, 2004 Posted July 13, 2004 Hi, tsd! I think it depends on where the data is coming from, how it is being used, and when you need to validate the data. You could use 3 fields and string concatenation or look at the left, right, middle functions, and possibly the patterncount function. If you need CAPS only, you may also need the UPPER function. What is the context of how the data is entered and used? --ST
Newbies tsd Posted July 14, 2004 Author Newbies Posted July 14, 2004 Thx Steve. I will have a look on the tip you gave me now. But another problem apperaed for me. I have a field with 01, 02 03 .... but when it came to 10 the zero should dissapear. How could that If calculation look like ? I am a very novice user of Filemaker. Best Regards...
Steve T. Posted July 14, 2004 Posted July 14, 2004 Hi, tsd! The 01..010 thing also depends on how those numbers are created... I am assuming they were not manually typed since you say "when it came to 10", so I am not sure of the best way to get what you want. If you want to make a calc field to show an equivalent value of another field but w/no leading zero for values of 10 or more up to 100... try equivcalc= If (serialnum >= 10 and Left(serialnum="0", Right(serialnum, 2), serialnum) In English... If serialnum is .gte. 10 and starts with a 0, then equivcalc = right 2 digits of serialnum, else equivcalc = serialnum If you anticipate going over 100, then you'd have to change this to a switch/case statement to list several conditions, or use the length() function to count digits and just remove the front 0 if there is one. Hope this helps some, though... --ST I guess my GreaterThan or EqualTo sign is not web-friendly, so I changed it to >= above. Use the actual GTE symbol in the calc though.
Recommended Posts
This topic is 7706 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