October 28, 200520 yr Can anyone point me where I can find such a calc? There has to one out there...this is such a common tool for DB's...I don't know why FM just doesn't provide it... Edited October 28, 200520 yr by Guest
October 28, 200520 yr This topic has been discussed a few times in the past. I did a search for "Area Code" and it returned this recent post among the 64 hits , Click Here I'm sure if you use "Zip Code" you would get a lot more hits. HTH Lee :cool:
October 28, 200520 yr Author OK, I have explored a solution but can't get it to work... I have broken it down to creating two new calculations: 1) Create a calc field called "EXTRACT AREA CODE" Middle(Main Phone;Position(Main Phone;" ";1;1)+1;3) This baby goes out and extracts the first three numbers (area code) from the string text in the field (Main Phone). 2) CREATE a CALC field called "INSEERT AREA CODE" that is a nested IF statement that checks to see if my MAIN Area Code field is empty, and if it is, inserts the "extracted" area code. Case( IsEmpty(Main Area Code); "extract area code"; "") BUt, unfortunately this solution is not working... any ideas people???
October 28, 200520 yr It all depends on how your phone field is formatted. I am guessing you have local and long distance numbers - perhaps you shoud start by examining how many digits are there (using the Length() function). If I had to have this functionality, I would make a separate field for the area code, and enforce a tighter discipline for data entry in general. There's too much room for ambiguity here: for example, it could be assumed that a number with more than 11 digits is an international number; then alongs comes the user that enters "123-456-7890, ext.2020".
Create an account or sign in to comment