Solved

Format a ssn column in gridview.

Posted on 2007-03-27
2
570 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

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…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
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 new code templates in NetBeans IDE 8.0 for Windows.

690 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