SSRS format US Phone numbers

I have resorted to taking care of this in the stored procedure.  If you have a good way of doing it inside of Visual Studio, let me know in the comments!

The T-SQL looks like this. I believe I got the trick from here.

CASE WHEN LEN(PhoneNumber1) = 10
THEN '(' + Stuff(Stuff(PhoneNumber1,7,0,'-'),4,0,') ')
ELSE Stuff(RIGHT(PhoneNumber1,7),4,0,'-')
END as PhoneNumber1,
Advertisements
This entry was posted in Business Intelligence and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s