Below is the formula I have but it does not work. I keep getting the following error: A Colon is expected here and it highlights formula. The two fields are numbers.
If there is a better way to do this, I am open to suggestions.
numbervar area;
numbervar phone;
numbervar num;
numbervar phLength;
area = {CMASTR.CU_ARE};
phone = {CMASTR.CU_PHN};
num = tonumber(totext(area,0,"") + totext(phone,0,""));
phLength = len(totext(num,0,""));
Select phLength
Case '7'
formula: = left(totext(phone,0,""),3) + "-" + right(totext(phone,0,""),4)
Case '10'
formula: = "(" + totext(area,0,"") + ") " + left(totext(phone,0,""),3) + "-" + right(totext(phone,0,""),4)
Default
formula: = ""
End Select
If there is a better way to do this, I am open to suggestions.
numbervar area;
numbervar phone;
numbervar num;
numbervar phLength;
area = {CMASTR.CU_ARE};
phone = {CMASTR.CU_PHN};
num = tonumber(totext(area,0,"") + totext(phone,0,""));
phLength = len(totext(num,0,""));
Select phLength
Case '7'
formula: = left(totext(phone,0,""),3) + "-" + right(totext(phone,0,""),4)
Case '10'
formula: = "(" + totext(area,0,"") + ") " + left(totext(phone,0,""),3) + "-" + right(totext(phone,0,""),4)
Default
formula: = ""
End Select