If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Import data
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. |
#2
|
|||
|
|||
Import data
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 -- Jerry Whittle, Microsoft Access MVP Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder. "Renetta" wrote: 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. |
Thread Tools | |
Display Modes | |
|
|