Hi,
I been trying to figure out how to add to my query to reformat phone number that are stored in the PHONE_VIEW as xxx-xxx-xxxx. I need to reformat to (xxx)xxx-xxxx.
Here is my query so far
select
person.personId,
person.first_name,
person.last_name,
phone.phone_number,
phone.phone_type
from person_view person
left join (select personId, phone_type,
('(' + substr(phone_number,1,3) + ')' + substr(phone_number, 5,3) + '-' + substr(phone_number,9,4)) as phone_number,
from phone_view ) phone
on person.personId = phone.personId and phone.phone_type in ('home', 'work','mobile')
I could not get this to work.
Any help is greatly appreciated. Thanks.