Import data

G

Guest

I have a weekly excel spreadsheet that I need to import. One of the columns
reflect SSN's, however those SSN's reflecting a leading zero(s) drop off
during the import process. I understand that there isn't a way to prevent
this, however is there a statement that can be written like:

IIf 9 digits (note could also be alpha in the mix) leave as is, but if less
add leading zero's to accomodate hense revealing xxx-xx-xxxx.

Please no that I am fairly new to ACCESS when providing assistance. Thanks.
 
G

Guest

There could be an easy way to prevent this. Change the SSN field from number
to text. Same goes if you have a Zip Code field as text.

Now if there isn't a zero in the spreadsheet, it's just formatted to look
like it, you could try the following in a query:

LeadingZeros: String(9-Len([SSAN]),"0") & [SSAN]

If the actual number of characters aren't important, you can have the SSAN
display properly with a format like below at the table, form, or report level:
000-00-0000
 

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

Top