To add to what Brian said, you could just leave them as they are in the
database and format them in the presentation layer.
But if you have some numbers with formatting and some without, it's better
to decide on how you want them in the database and to change the ones that
are not stored that way. I prefer to not include formatting and to do this
client side. It makes it easier when the boss decides that from now on, he
wants to change telephone number formatting from (206) 555-1212 to
206-555-1212.
Don't forget to validate future data entries.
[quoted text, click to view] "Brian Lawton" <brian.k.lawton@redtailcreek.com> wrote in message
news:uPLKPB4pFHA.248@TK2MSFTNGP14.phx.gbl...
> Assuming that your Phone attribute is a string and always contains 10
> characters, you could use the following:
>
> update table
> set Phone = '(' + left(Phone, 3) + ') ' + substring(Phone, 4, 3) + '-' +
> right(Phone, 4)
>
> --
> --Brian
> (Please reply to the newsgroups only.)
>
>
> "_adrian" <test @ test.com> wrote in message
> news:O09JUl3pFHA.3404@TK2MSFTNGP11.phx.gbl...
>>I have a column in a table full of phone numbers, except the user entered
>>them just as "a number" so (206) 555-1212 looks like 2065551212
>>
>> Is there a way in which I can run something that will format all of these
>> with the appropriate parantheses, etc...? (ie. make them look like phone
>> numbers again)?
>>
>
>