Solved

Format a ssn column in gridview.

Posted on 2007-03-27
2
565 Views
Last Modified: 2013-11-26
I am trying to format a ssn filed like 123456789  to 123-45-6789 in gridview.
Please help.
Thanks.
0
Comment
Question by:LuckyCold
2 Comments
 
LVL 15

Accepted Solution

by:
crisco96 earned 500 total points
ID: 18798770
The easiest way is to modify your sql to include the formatting:

select substring(ssn, 1, 3) + '-' + substring(ssn, 4, 2) + '-' + substring(ssn, 6, 4) as SSN
from sometable
0
 

Author Comment

by:LuckyCold
ID: 18803596
it works thank  you
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Latency in .net app using DB in .net 21 61
Connection String 16 54
SQL Login 17 50
Call windows 10 virtual keyboard from windows forms app 2 32
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question