SSN split

T

Ted Dawson

ASP/Access

One of my fields is the customer's social security number, all originally
entered as a 9-character string. How can I split and display that into 3-2-4
format?
 
A

Aaron [SQL Server MVP]

set rs = conn.execute("SELECT SSN From Table")
ssn = rs(0)
response.write left(ssn, 3) & "-" & mid(ssn, 4, 2) & "-" & right(ssn, 4)
 
S

Stefan Berglund

On Sat, 11 Sep 2004 14:43:36 -0500, "Ted Dawson"
in said:
ASP/Access

One of my fields is the customer's social security number, all originally
entered as a 9-character string. How can I split and display that into 3-2-4
format?

Not all SSNs are created equal! A perfectly valid substitute,
for instance, is the federal tax id # which can be a variety of
several formats including your favored 3-2-4 format.
 
T

Ted Dawson

Perfect! Thank you.





Aaron said:
set rs = conn.execute("SELECT SSN From Table")
ssn = rs(0)
response.write left(ssn, 3) & "-" & mid(ssn, 4, 2) & "-" & right(ssn, 4)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top