Welcome Guest Search | Active Topics | Sign In | Register

SSN Format Options
nomo
Posted: Saturday, May 17, 2008 8:16:30 AM
Rank: Member
Groups: Member

Joined: 4/6/2008
Posts: 11
I have a Social Security field (VARCHAR(11)) from an Oracle database stored without the dashes. I want to diplay the SSN with the dashes in a grid. What format string should I use?

I tried {0:###-##-####} without results. Should I use TO_NUMBER(SSNUM) in the query and some number formatting string? Which?

Thanks in advance.
eo_support
Posted: Saturday, May 17, 2008 8:32:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will have to format the number by yourself. There are essentially two ways to do it.

1. You can do it on the SQL level. Basically you would change your SELECT statement to return the desired result. It will be something like SELECT SUBSTRING(SSNUM, 0, 3) + '-' + SUBSTRING(SSNUM, 3, 2)

2. You can use a CustomColumn and provide your own ClientSideGetText JavaScript routine to do the formatting in JavaScript;

The first method should be much more efficient because Oracle obviously can run the expression much faster than JavaScript.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.