PC Review


Reply
Thread Tools Rate Thread

Data type Conversion from Excel inconsistency

 
 
=?Utf-8?B?UmFjZXI0OQ==?=
Guest
Posts: n/a
 
      3rd Oct 2007
I have an Excel spreasheet that I import to Excel via Macro in Access. The
data type that gets imported from Excel from a column "Age" (which is numeric
data), gets changed to "Text" instead of seeing it as numeric. Is there a
way through my import Macro or VB to check its type, then change this type to
numeric?

Thanks
 
Reply With Quote
 
 
 
 
Jeff Boyce
Guest
Posts: n/a
 
      3rd Oct 2007
Here's another approach that may help you circumvent the problem you're
seeing...

Create a "temp" table into which you'll import your Excel data ... and make
all the fields of type "text".

Import from Excel into that table.

Create queries that "convert" data from the temp table into the proper data
types, and appends (or updates) records in your more permanent Access
tables.

I mention a distinction between "temp" and "permanent" Access tables because
raw Excel data is rarely well normalized. If you want to get good use of
Access' relationally-oriented features and functions, you need to have a
well-normalized table structure.

Regards

Jeff Boyce
Microsoft Office/Access MVP



"Racer49" <(E-Mail Removed)> wrote in message
news:7E6BE907-CF96-4B67-BC5A-(E-Mail Removed)...
>I have an Excel spreasheet that I import to Excel via Macro in Access. The
> data type that gets imported from Excel from a column "Age" (which is
> numeric
> data), gets changed to "Text" instead of seeing it as numeric. Is there a
> way through my import Macro or VB to check its type, then change this type
> to
> numeric?
>
> Thanks



 
Reply With Quote
 
=?Utf-8?B?UmFjZXI0OQ==?=
Guest
Posts: n/a
 
      3rd Oct 2007
That will work! I had not thought of the interim step of having my table be
permanent, then import from the "temp" file via query.. Thanks for this great
tip!

"Jeff Boyce" wrote:

> Here's another approach that may help you circumvent the problem you're
> seeing...
>
> Create a "temp" table into which you'll import your Excel data ... and make
> all the fields of type "text".
>
> Import from Excel into that table.
>
> Create queries that "convert" data from the temp table into the proper data
> types, and appends (or updates) records in your more permanent Access
> tables.
>
> I mention a distinction between "temp" and "permanent" Access tables because
> raw Excel data is rarely well normalized. If you want to get good use of
> Access' relationally-oriented features and functions, you need to have a
> well-normalized table structure.
>
> Regards
>
> Jeff Boyce
> Microsoft Office/Access MVP
>
>
>
> "Racer49" <(E-Mail Removed)> wrote in message
> news:7E6BE907-CF96-4B67-BC5A-(E-Mail Removed)...
> >I have an Excel spreasheet that I import to Excel via Macro in Access. The
> > data type that gets imported from Excel from a column "Age" (which is
> > numeric
> > data), gets changed to "Text" instead of seeing it as numeric. Is there a
> > way through my import Macro or VB to check its type, then change this type
> > to
> > numeric?
> >
> > Thanks

>
>
>

 
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
RE: data type inconsistency Jim Thomlinson Microsoft Excel Misc 0 6th Jul 2009 11:07 PM
The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. M. Bruil Microsoft Access 0 25th Mar 2009 08:10 PM
data type conversion when automating excel from access =?Utf-8?B?VGFueWE=?= Microsoft Access VBA Modules 5 1st Aug 2007 11:39 PM
Data type conversion from Excel Jon Microsoft Access External Data 5 17th Aug 2005 09:14 PM
Excel VBA - Data Type Conversion problem PaulC Microsoft Excel Programming 3 10th May 2004 04:53 PM


Features
 

Advertising
 

Newsgroups
 


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