Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

USING IF -THEN -ELSE WITH PICTURE FUNCTION 1

Status
Not open for further replies.

JULY1

MIS
May 13, 2002
16
US
I am using the following as my formula for phone numbers:

picture({CallDetailRecord.callingPartyNumber},"XXX-XXX-XXXX")

My problem is that this is picking up our 5 digit extensions (ex. 15330) as 153-30-.

How can I set up a formula to use the "XXX-XXX-XXXX" when there are ten digits to the phone number, and then to use "XXXXX" when there are five digits (for extensions).
 
Try creating a formula to display it using:

if len(trim({table.phone})) = 10 then
picture(phone,"XXX-XXX-XXXX")
else
if len(trim({table.phone})) = 15 then
picture(phone,"XXX-XXX-XXXX-XXXXX")
else
"Invalid"

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top