PC Review


Reply
Thread Tools Rate Thread

Changing data types

 
 
Rick
Guest
Posts: n/a
 
      23rd Aug 2007
I am trying to use ODBC to query an Excel spreadsheet. The ODBC driver
looks at the first 8 rows in each column to determine the datatype. I
have mixed numbers and text, but the driver thinks the column is
numeric. As a result, text entries are not returned.

My solution is to change the format of the cells to Text. This works,
but I have to reenter each numeric value in order for Excel to see
them as Text. Is there a quick shortcut for reentering text in
selected cells? Thank you very much.

Rick Quatro

 
Reply With Quote
 
 
 
 
Pete_UK
Guest
Posts: n/a
 
      23rd Aug 2007
Once you have imported the data, check that the format in these cells
is not set to Text - if it is, highlight the column and change the
format to General (it will not take effect yet). Then select an empty
cell beyond your data (so the format is also set to General) and click
<copy>. Then highlight the column with mixed numbers and text and Edit
| Paste Special | Values (check) | Add (check - in the Operation part)
| OK then <Esc>. This should convert your "numbers" back to numbers.

You might also try Data | Text-to-columns, after first changing the
format to General.

Hope this helps.

Pete

On Aug 23, 10:42 pm, Rick <rickqua...@gmail.com> wrote:
> I am trying to use ODBC to query an Excel spreadsheet. The ODBC driver
> looks at the first 8 rows in each column to determine the datatype. I
> have mixed numbers and text, but the driver thinks the column is
> numeric. As a result, text entries are not returned.
>
> My solution is to change the format of the cells to Text. This works,
> but I have to reenter each numeric value in order for Excel to see
> them as Text. Is there a quick shortcut for reentering text in
> selected cells? Thank you very much.
>
> Rick Quatro



 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      23rd Aug 2007
Hi Pete,

Actually, I want to convert everything to text. I will give it a try.
Thanks.

Rick

On Aug 23, 5:55 pm, Pete_UK <pashu...@auditel.net> wrote:
> Once you have imported the data, check that the format in these cells
> is not set to Text - if it is, highlight the column and change the
> format to General (it will not take effect yet). Then select an empty
> cell beyond your data (so the format is also set to General) and click
> <copy>. Then highlight the column with mixed numbers and text and Edit
> | Paste Special | Values (check) | Add (check - in the Operation part)
> | OK then <Esc>. This should convert your "numbers" back to numbers.
>
> You might also try Data | Text-to-columns, after first changing the
> format to General.
>
> Hope this helps.
>
> Pete
>
> On Aug 23, 10:42 pm, Rick <rickqua...@gmail.com> wrote:
>
> > I am trying to use ODBC to query an Excel spreadsheet. The ODBC driver
> > looks at the first 8 rows in each column to determine the datatype. I
> > have mixed numbers and text, but the driver thinks the column is
> > numeric. As a result, text entries are not returned.

>
> > My solution is to change the format of the cells to Text. This works,
> > but I have to reenter each numeric value in order for Excel to see
> > them as Text. Is there a quick shortcut for reentering text in
> > selected cells? Thank you very much.

>
> > Rick Quatro



 
Reply With Quote
 
Pete_UK
Guest
Posts: n/a
 
      23rd Aug 2007
Sorry, I'd got it the wrong way round. You could insert a new column
next to the one you want to convert and enter this formula:

=""&A1

and copy this down by double-clicking the fill handle. Then with the
data already highlighted, click <copy> then Edit | Paste Special |
Values (check) | OK then <Enter>. Then you can delete your original
column.

Hope this helps.

Pete

On Aug 23, 11:08 pm, Rick <rickqua...@gmail.com> wrote:
> Hi Pete,
>
> Actually, I want to convert everything to text. I will give it a try.
> Thanks.
>
> Rick
>
> On Aug 23, 5:55 pm, Pete_UK <pashu...@auditel.net> wrote:
>
>
>
> > Once you have imported the data, check that the format in these cells
> > is not set to Text - if it is, highlight the column and change the
> > format to General (it will not take effect yet). Then select an empty
> > cell beyond your data (so the format is also set to General) and click
> > <copy>. Then highlight the column with mixed numbers and text and Edit
> > | Paste Special | Values (check) | Add (check - in the Operation part)
> > | OK then <Esc>. This should convert your "numbers" back to numbers.

>
> > You might also try Data | Text-to-columns, after first changing the
> > format to General.

>
> > Hope this helps.

>
> > Pete

>
> > On Aug 23, 10:42 pm, Rick <rickqua...@gmail.com> wrote:

>
> > > I am trying to use ODBC to query an Excel spreadsheet. The ODBC driver
> > > looks at the first 8 rows in each column to determine the datatype. I
> > > have mixed numbers and text, but the driver thinks the column is
> > > numeric. As a result, text entries are not returned.

>
> > > My solution is to change the format of the cells to Text. This works,
> > > but I have to reenter each numeric value in order for Excel to see
> > > them as Text. Is there a quick shortcut for reentering text in
> > > selected cells? Thank you very much.

>
> > > Rick Quatro- Hide quoted text -

>
> - Show quoted text -



 
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
Changing data types in a macro =?Utf-8?B?VGh1eSBQaGFt?= Microsoft Access Macros 4 18th May 2007 12:28 PM
Changing data types =?Utf-8?B?QW5kcmVhcw==?= Microsoft Access 10 27th Jul 2006 09:56 AM
Changing Field Data Types of Imported Data Jason Microsoft Access 2 16th Mar 2004 05:24 PM
changing data types Dabbler Microsoft Access External Data 2 30th Jan 2004 02:43 AM
Need help changing data types Elisa Microsoft Access Queries 0 30th Oct 2003 07:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:22 PM.