A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Import data



 
 
Thread Tools Display Modes
  #1  
Old February 14th, 2007, 04:43 PM posted to microsoft.public.access.queries
Renetta
external usenet poster
 
Posts: 50
Default 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  
Old February 14th, 2007, 05:51 PM posted to microsoft.public.access.queries
Jerry Whittle
external usenet poster
 
Posts: 4,732
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.