Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about importing data as Soc Sec #

Status
Not open for further replies.

paul123456

Technical User
Apr 29, 2002
518
US
Hi i noticed that when i import information into my database, one of my fields that is being imported is a social security number but im having a problem with some of them. it puts it in the database as a number..for example if i import a record with a social of 123-23-3433 it works fine but when i import 023-23-3433 it puts it in the database as _23-23-3433 leaving the first number blank? I do have the input mask on the database formatted as a social

i wanted to know how i can eliminate this from happening? I am importing this information from an excel file. Thanks, PAUL

 
Set the field to import as text instead of numbers. A social security number should be stored in your db as text anyway, as number field types should only be used for fields that will have calculations perfromed against them. By importing the SSNs as text, you will preserve all zeros. -------------------------------------
Only two things are infinite, the
universe and human stupidity, and
I'm not sure about the former.
(Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: mstrmage@tampabay.rr.com
 
i c that makes sence....I was wondering what it was..thnx a lot Thanks, PAUL

 
well i tested it out but it doesn't seem to work still. on the excel sheet the the info that im importing is on if i set column under social security number to text it will take off the zeros at the begining making some socials read as 34225 instead of 000-03-4225, also i checked the database and it is set to text? even when i format the column on the excel file to be like socials it still doesn't work? Thanks, PAUL

 
I guess the next step would be to look at the format/display properties of the table that you are importing to. If you set ehd isplay property to:

000-000-0000

Access will store the data as shortened number but display everything as it should, i.e. it will add zeros for the display.

Another method would be to import the data as you currently are but to a temporary table forst, then run an append query from this temp table into your primary data table and use something like:

CStr(Format([fieldname], "000-000-0000"))

as the field for the SSN line....this will format and convert it as it appends the data to the table. ****************************
Only two things are infinite, the
universe and human stupidity, and
I'm not sure about the former.
(Albert Einstein)

Robert L. Johnson III
MCSA, CNA, MCP, Network+, A+
w: robert.l.johnson.iii@citigroup.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top