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.
|
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
|