Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel cannot 'FIND' data imported from oracle

Please help,

I frequently import data from databases contained in
Oracle using SQL. Once i get the data into the
spreadsheet and try to do VLOOKUPs or even simply 'FIND' a
number or text string my query has returned, i get an
error message. I have two solutions for this.

1. If the returned column is made up of only numbers (not
text), I can multiply the contents by 1, then do a VLOOKUP
or FIND on the new column. The numbers are the same, but
Excel only recognizes them after I have multiplied by one.

2. If there is text contained in the field returned, I
cannot use the above trick. I have to save as a ".csv"
file, then copy/paste special (values only) back into the
sheet I want to perform the VLOOKUP in. This appears to
change the format of all fields to 'text' and not 'number'
so a VLOOKUP referencing a typed-in number doesn't work.
I can VLOOKUP on the text, but not on columns that are
strictly numbers.


Is this some kind of weird formating issue? I have tried
formating the cells, but that doesn't work. The problem
seems deeper than that. Does anyone know a solution other
than the time consuming way I am doing it now??

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Excel cannot 'FIND' data imported from oracle

You can try modifying the query you're using to get the
data out of Oracle to cast the data as interger, real,
string, etc.

for example:
SELECT CAST(ordernumber as integer) newordernum
FROM ......
WHERE......

Are you using ADO to get the data and place it directly
into Excel, or are you using Oracle SQLplus to get the
data and then pasting the data into Excel?

If you're using ADO and you're putting the data into an
array, you can use the Dim statement to set the datatype
to string or double, etc.

Hope this helps,
Raul

-----Original Message-----
Please help,

I frequently import data from databases contained in
Oracle using SQL. Once i get the data into the
spreadsheet and try to do VLOOKUPs or even simply 'FIND'

a
number or text string my query has returned, i get an
error message. I have two solutions for this.

1. If the returned column is made up of only numbers

(not
text), I can multiply the contents by 1, then do a

VLOOKUP
or FIND on the new column. The numbers are the same,

but
Excel only recognizes them after I have multiplied by

one.

2. If there is text contained in the field returned, I
cannot use the above trick. I have to save as a ".csv"
file, then copy/paste special (values only) back into

the
sheet I want to perform the VLOOKUP in. This appears to
change the format of all fields to 'text' and

not 'number'
so a VLOOKUP referencing a typed-in number doesn't

work.
I can VLOOKUP on the text, but not on columns that are
strictly numbers.


Is this some kind of weird formating issue? I have

tried
formating the cells, but that doesn't work. The problem
seems deeper than that. Does anyone know a solution

other
than the time consuming way I am doing it now??

Thanks for any help.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel cannot 'FIND' data imported from oracle


Raul,

Thanks. That solved the problem where I lookup numbers which are
integers. However, I also need to use VLOOKUP on a column of data which
returns integers as well as text/number combinations. For example 62202
is one invoice number, while another is EN030544.

Is it possible to have one column returned as integers and the other as
text? I tried doing this with no success. I am an SQL rookie so maybe
I am doing something wrong. If I can return the 'combination' column as
text, I should be able to get the VLOOKUP working.

NOTE: I am using linked tables if that makes a difference.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 136
Default Excel cannot 'FIND' data imported from oracle

Syntax

VLOOKUP(lookup_value,table_array,col_index_num,ran ge_lookup)

Have you tried setting range_lookup to FALSE ?

jjanzen wrote:
Raul,

Thanks. That solved the problem where I lookup numbers which are
integers. However, I also need to use VLOOKUP on a column of data which
returns integers as well as text/number combinations. For example 62202
is one invoice number, while another is EN030544.

Is it possible to have one column returned as integers and the other as
text? I tried doing this with no success. I am an SQL rookie so maybe
I am doing something wrong. If I can return the 'combination' column as
text, I should be able to get the VLOOKUP working.

NOTE: I am using linked tables if that makes a difference.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 459
Default Excel cannot 'FIND' data imported from oracle

If you *are* using ADO, you could use a disconnected recordset (i.e.
client-side cursor) and a cursor type which supports bookmarks (e.g.
static cursor) and retain the recordset object by keeping it in scope
somehow (e.g. module-level variable). When you wanted to find a row
based on a column value, you could go back to your recordset and apply
a filter using its Filter property e.g.

With MyRecordset
.Filter = "invoice_nbr = 'EN030544'"
If .RecordCount 0 Then
' Do something with filtered rows
End If
End With

Look up Filter in the help:

http://msdn.microsoft.com/library/de...dprofilter.asp

Otherwise, you may find it a better approach to hit the database each
time, rather than filter the results in the Excel GUI e.g.

SELECT ...
FROM ...
WHERE invoice_nbr = 'EN030544'

--

JWolf wrote in message ...
Syntax

VLOOKUP(lookup_value,table_array,col_index_num,ran ge_lookup)

Have you tried setting range_lookup to FALSE ?

jjanzen wrote:
Raul,

Thanks. That solved the problem where I lookup numbers which are
integers. However, I also need to use VLOOKUP on a column of data which
returns integers as well as text/number combinations. For example 62202
is one invoice number, while another is EN030544.

Is it possible to have one column returned as integers and the other as
text? I tried doing this with no success. I am an SQL rookie so maybe
I am doing something wrong. If I can return the 'combination' column as
text, I should be able to get the VLOOKUP working.

NOTE: I am using linked tables if that makes a difference.



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Imported Oracle Data S. Kissing Excel Discussion (Misc queries) 0 November 16th 07 08:16 PM
Excel data upload to Oracle Brent Excel Discussion (Misc queries) 0 March 8th 07 07:01 PM
How to get data from Oracle Database to Excel? David Willis New Users to Excel 1 March 31st 06 01:57 PM
Excel sheet data to oracle. Frank Kabel Excel Programming 1 February 12th 04 06:36 PM
Oracle data to excel Kim[_8_] Excel Programming 2 October 21st 03 12:29 PM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"