Click to See Complete Forum and Search --> : Phone Format


Szhark
10-24-2000, 11:08 AM
Quickie..

How do I format a phone number in my select statement? I assume I should use the tochar() function but I'm not sure exactly what to write. The phone number is stored as XXXXXXXXXX, and I want (XXX) XXX-XXXX.

Thanks!

abc
10-24-2000, 11:30 AM
Hi Szhark.
check this one.

select 'New Phone Number - ('||
substr(to_char(PHONE_NUM,'0999999999'),2,3)||') '||
substr(to_char(PHONE_NUM,'0999999999'),5,3)||' - '||
substr(to_char(PHONE_NUM,'0999999999'),8,4)
from YOUR_TABLE;

Thanks
ABC