September 25, 200619 yr I need to format a postal code. I have about 400 of them in my database and this code includes both letters & numbers (example: K0J1L0 is what was imported. I need it to appear K0J 1L0). It seems easy enough to add this space between the first 3 and last 3 letters/numbers. I used the following: Let ( imput = Filter (Postal Code; "0123456789") ; Left (imput; 3) & " " & Right (imput; 3) ) I formated the calculation to be text. Yet it returned values that were only numbers! All of the letters became numbers! Can you help?
September 25, 200619 yr The filter return the expect results I believe. It Filtered out everything except the "0123456789" as it reads. In the USA, this would probably what you wanted, but I'm not familiar with the Canada's Zips patterns, so maybe you can provide a few examples of what you have now, and what you want as the results. Lee Edited September 25, 200619 yr by Guest
September 25, 200619 yr Author Hi Lee! Thanks! I figured out the problem last night after posting. I removed the filtering line and it works fine now. Thanks for all of your help!
September 25, 200619 yr You probably still need the filter to remove any non-alphanumeric characters that the user may enter, because the user may or may not enter a space between the 3rd and 4th character. Also note, the letters D, F, I, O, Q and U are not used. So, you could set up your filter function like this: Filter("0123456789ABCEGHJKLMNPRSTVWXYZ" Let ( input = Filter (Postal Code; "0123456789ABCEGHJKLMNPRSTVWXYZ"); case(Length(input)<>6;"**INVALID**";Left (input; 3) & " " & Right (input; 3)) )
Create an account or sign in to comment