Data type problem when I link an Excel sheet

alx

New Member
Joined
Mar 13, 2002
Messages
7
Hello

I get a data type mismatch in a JOIN query between 2 linked tables (Excel sheets). In the table A the column 1 is interpreted as TEXT and in the table B the column 2 is interpreted as NUMBER. I've tried to change the format in both sheets, linked again the sheets but nothing change.

How could I force the Data Type in linked tables ?
OR
How does Access choose the Data Type ?

Thanks a lot,
Alx.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
In changing the format in Excel, simply selecting the column and changing the format may NOT change your entries. For example, if you have a column of text entries and change the column format to Number, the values will still be considered Text, because that is how they are entered.

What you want to do is after you change the column format, do a Text to Columns on the column and change the entries that way (to General for numbers, or to Text).
 
Upvote 0
Access makes a guess as to the field format for the entire column based on the first few records in the given field. One possible option, if you wish to continue to Link is to put dummy field values in the first few fields and encourage Access to "guess" the way you want it to guess.

Another option is much more involved. Transferring the spreadsheet cell by cell into a recordset and writing it into an Access Table. Yes, you'd lose the realtime nature of changes to the XLS.

You might also setup a temporary table (format the fields) that you can write the linked table contents to and then join together with your queries.
I am not certain if all field formats will translate readily - your 'Text' field that is really 100% numbers is copied to a Number field should work. Most field types should write into string/text format fields.
 
Upvote 0
Thank you jmiskey ! It works !

I didn't know this feature. I will save time now because usually I worked with functions for parsing data from one column to others.

Alx.
 
Upvote 0

Forum statistics

Threads
1,221,614
Messages
6,160,838
Members
451,672
Latest member
LexCie

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top