Phone Format
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Phone Format

  1. #1
    Join Date
    Feb 2000
    Posts
    24
    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!

  2. #2
    Join Date
    Aug 2000
    Posts
    53
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width