Help! Text and Numbers in database Query from another worksheet?

MattCole

New Member
Joined
Jun 22, 2010
Messages
5
Hi - hope someone can help.....
I have made a database query to return data from another excel worksheet (all in excel 2003, and on Windows XP)
It's fine EXCEPT that some of the columns in the external datasource worksheet contain text rather than numbers. The query returns these as blank while the columns with number in the fields (even when they are a result of a formula) come back as numbers fine.
I've tried formatting the columns as text in both the extrnal source and the 'recipient' worksheet but no difference.
Help! It seems straightforward...but perhaps it's not?
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Because excel is not a database, a given field (column) can contain data of varying types. The query will look at the top 8(?) rows of of the data it's querying to decide what data type to return. Whichever data type is the most prevalent in that top 8 rows is what the query returns for the wholecolumn. It won't return different datatypes in a given column.
So make sure that the source data has the appropriate data type in the top 8 rows (cell formats will be important here too; text, number, date etc.)
I got round this by putting in 5 or more rows of dummy data of the required type at the top of the source data and hiding those rows.
 
Last edited:
Upvote 0
Hi p45Cal, thanks a lot for that, I'll check this out hopefully today and post an update. (PS I can always be bothered with replying on forums!:cool:)
 
Upvote 0

Forum statistics

Threads
1,214,665
Messages
6,120,803
Members
448,990
Latest member
rohitsomani

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