Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hll hll is offline
external usenet poster
 
Posts: 6
Default Query Parameters

I am trying to select data from an Oracle (external) table. I am using the
"Import Data" option. However, my "Parameter" button is not enabled (Grayed
out). Any idea why or how to get it enabled?

What I need to do is enable the query to pull in values based on the value
in a cell. for example, with the following query:
"SELECT EMP_DETAILS.DEPARTMENT_ID, EMP_DETAILS.LAST_NAME,
EMP_DETAILS.SALARY" & Chr(13) & "" & Chr(10) & "FROM EMP_DETAILS EMP_DETAILS"
& Chr(13) & "" & Chr(10) & "WHERE (EMP_DETAILS.LAST_NAME="MY_NAME)" -

I am simply trying to replace "MY_NAME with the value that is in Sheet 3,
cell B3.

Any help you could give me is most appreciated. I am stumped!

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Query Parameters

check these:

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy


"hll" wrote:

I am trying to select data from an Oracle (external) table. I am using the
"Import Data" option. However, my "Parameter" button is not enabled (Grayed
out). Any idea why or how to get it enabled?

What I need to do is enable the query to pull in values based on the value
in a cell. for example, with the following query:
"SELECT EMP_DETAILS.DEPARTMENT_ID, EMP_DETAILS.LAST_NAME,
EMP_DETAILS.SALARY" & Chr(13) & "" & Chr(10) & "FROM EMP_DETAILS EMP_DETAILS"
& Chr(13) & "" & Chr(10) & "WHERE (EMP_DETAILS.LAST_NAME="MY_NAME)" -

I am simply trying to replace "MY_NAME with the value that is in Sheet 3,
cell B3.

Any help you could give me is most appreciated. I am stumped!

  #3   Report Post  
Posted to microsoft.public.excel.programming
hll hll is offline
external usenet poster
 
Posts: 6
Default Query Parameters

This was really helpful and it got me 90% there. However, what I need to do
is do a join based on 2 parameters. Every example I find only has one
parameter being repalced and whatever I try, it seemd to fail. Does anyone
have anyone have a snippet that can show how to handle multiple parameters.

For example:
"select X from employee where name=? and age ?"

Thanks again.

"Tom Ogilvy" wrote:

check these:

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy


"hll" wrote:

I am trying to select data from an Oracle (external) table. I am using the
"Import Data" option. However, my "Parameter" button is not enabled (Grayed
out). Any idea why or how to get it enabled?

What I need to do is enable the query to pull in values based on the value
in a cell. for example, with the following query:
"SELECT EMP_DETAILS.DEPARTMENT_ID, EMP_DETAILS.LAST_NAME,
EMP_DETAILS.SALARY" & Chr(13) & "" & Chr(10) & "FROM EMP_DETAILS EMP_DETAILS"
& Chr(13) & "" & Chr(10) & "WHERE (EMP_DETAILS.LAST_NAME="MY_NAME)" -

I am simply trying to replace "MY_NAME with the value that is in Sheet 3,
cell B3.

Any help you could give me is most appreciated. I am stumped!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Query Parameters

Post YOUR code for comments and suggestions.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"hll" wrote in message
...
This was really helpful and it got me 90% there. However, what I need to
do
is do a join based on 2 parameters. Every example I find only has one
parameter being repalced and whatever I try, it seemd to fail. Does anyone
have anyone have a snippet that can show how to handle multiple
parameters.

For example:
"select X from employee where name=? and age ?"

Thanks again.

"Tom Ogilvy" wrote:

check these:

http://nickhodge.co.uk/gui/datamenu/...taexamples.htm

http://www.dicks-clicks.com/excel/Ex...htm#Parameters

--
Regards,
Tom Ogilvy


"hll" wrote:

I am trying to select data from an Oracle (external) table. I am using
the
"Import Data" option. However, my "Parameter" button is not enabled
(Grayed
out). Any idea why or how to get it enabled?

What I need to do is enable the query to pull in values based on the
value
in a cell. for example, with the following query:
"SELECT EMP_DETAILS.DEPARTMENT_ID, EMP_DETAILS.LAST_NAME,
EMP_DETAILS.SALARY" & Chr(13) & "" & Chr(10) & "FROM EMP_DETAILS
EMP_DETAILS"
& Chr(13) & "" & Chr(10) & "WHERE (EMP_DETAILS.LAST_NAME="MY_NAME)" -

I am simply trying to replace "MY_NAME with the value that is in Sheet
3,
cell B3.

Any help you could give me is most appreciated. I am stumped!


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
MS Query - 2 Parameters cottage6 Excel Discussion (Misc queries) 2 July 17th 08 09:16 PM
Query parameters Lac Excel Programming 0 June 13th 06 12:59 PM
Query Parameters Texas_Toast Excel Discussion (Misc queries) 0 January 11th 06 03:14 PM
Web Query Parameters raboo2u Excel Programming 4 January 11th 04 08:54 PM
Query Parameters Jeff Excel Programming 1 November 18th 03 05:47 PM


All times are GMT +1. The time now is 05:33 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"