PC Review


Reply
Thread Tools Rate Thread

Data conversion on import

 
 
FP1
Guest
Posts: n/a
 
      7th Nov 2007
I'm importing data from an Excel spreadsheet and Access *refuses* to import
a column that has a model number that is sometimes text and sometimes a
number. In excel, I've done a 'format cells' and defined all as text, to no
avail. Access won't treat the numbers as text. Ironically, it imports the
text ones just fine. I suppose I could prefix all the model numbers with
'XX' or something, but that seems pretty cheesy.

WHAT am I doing wrong? Any help appreciated!

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
 
 
 
FP1
Guest
Posts: n/a
 
      7th Nov 2007
=?Utf-8?B?SmVycnkgV2hpdHRsZQ==?=
<(E-Mail Removed)> wrote in
news:B699B9C8-D74C-448C-944E-(E-Mail Removed):

> Access has a very bad habit of checking the first few rows of the
> Excel spreadsheet and assuming the data type. If there's a number or
> empty cell, Access might say that it's a number field no matter what
> is in the cells farther down.
>
> One trick is to insert a bogus first row in Excel that had the correct
> data types such as ABC for a text field. Import the spreadsheet then
> delete the bogus record.
>
> Your "cheesy" method should work if you append XX to the problem field
> in just the first record.


Good idea! I forgot about the first row thing. Thanks!

--
Posted via a free Usenet account from http://www.teranews.com

 
Reply With Quote
 
=?Utf-8?B?SmVycnkgV2hpdHRsZQ==?=
Guest
Posts: n/a
 
      7th Nov 2007
Access has a very bad habit of checking the first few rows of the Excel
spreadsheet and assuming the data type. If there's a number or empty cell,
Access might say that it's a number field no matter what is in the cells
farther down.

One trick is to insert a bogus first row in Excel that had the correct data
types such as ABC for a text field. Import the spreadsheet then delete the
bogus record.

Your "cheesy" method should work if you append XX to the problem field in
just the first record.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

"FP1" wrote:

> I'm importing data from an Excel spreadsheet and Access *refuses* to import
> a column that has a model number that is sometimes text and sometimes a
> number. In excel, I've done a 'format cells' and defined all as text, to no
> avail. Access won't treat the numbers as text. Ironically, it imports the
> text ones just fine. I suppose I could prefix all the model numbers with
> 'XX' or something, but that seems pretty cheesy.
>
> WHAT am I doing wrong? Any help appreciated!

 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      7th Nov 2007
On 07 Nov 2007 17:53:08 GMT, FP1 <(E-Mail Removed)> wrote:

>I'm importing data from an Excel spreadsheet and Access *refuses* to import
>a column that has a model number that is sometimes text and sometimes a
>number. In excel, I've done a 'format cells' and defined all as text, to no
>avail. Access won't treat the numbers as text. Ironically, it imports the
>text ones just fine. I suppose I could prefix all the model numbers with
>'XX' or something, but that seems pretty cheesy.
>
>WHAT am I doing wrong? Any help appreciated!


You're not doing anything wrong. Since Excel cells don't have strong datatypes
and Access fields do, the import mechanism must GUESS the appropriate datatype
based on the first few rows in the sheet being imported - and it can (and
will) guess wrong in circumstances like this.

The only good getaround I know is to put a dummy row at the top of the
spreadsheet with an unambiguous text value, and discard the row after import.

You *might* be able to get satisfactory results by linking to the spreadsheet
(rather than importing), and run an Append query.

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
import csv conversion & import spec error Maver1ck666 Microsoft Access External Data 1 21st Aug 2009 02:44 PM
Import text file data conversion problem in Access07 standridgekelly Microsoft Access 2 9th Apr 2008 05:10 PM
Data Conversion and Data Formats Services by Data Entry India withlowest possible rates Data Entry India Microsoft Access 0 31st Mar 2008 12:09 PM
Professional Data Conversion,Data Formats and Affordable Data EntryServices by Data Entry India Data Entry India Microsoft Access Form Coding 0 31st Mar 2008 11:50 AM
PLEASE!! How can I un-grey the 'Data-Import External Data-Import Data' option ??? kirkm Microsoft Excel Programming 13 8th Aug 2006 10:01 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 AM.