Solved

Format a ssn column in gridview.

Posted on 2007-03-27
2
568 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
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 synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

840 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