View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jockel Jockel is offline
external usenet poster
 
Posts: 3
Default Parameter Query Cell substitution

When I update the query I have to put in a holding value for each parameter
and then I have to substitute for that holding value in the parameter by
reference the cells for each parameter.

Am I doing this wrong or is this the only way to set up a series of
parameters that I can then substitute the values by updating the cell
contents?

What I want to be able to do is paste into a column a group of 1 to 400 user
id's and then query SQL for where those ID's are assigned values in a series
of tables. The query works great when I specifiy the specific user IDs either
directly in the query or in the Parameter directly. When I substitute the
fixed parameter for a cell reference It works. When I update the cell
reference it does not seem to work. So there are two problems. How do I
create parameters for 400 entries and why does Excel not update correctly
when I substitute the values in those cells?

"Jockel" wrote:

I am able to build a parameter based query. I want to substitute the
parameters by using Cell references in the query. I looks like I must add on
parameter for each cell in a column. The query needs to process 200
parameters at a time. Is there an easier way to configure this?

Current dqy file looks like this:

XLODBC
1
Description=xxxxxx Lab;DRIVER=SQL
Server;SERVER=xxxxxx;UID=UGS;APP=Microsoft® Windows® Operating
System;WSID=PTLLG3L7C91;DATABASE=xxxxx
SELECT jc_test2.Access, jc_test2.Access_Type, jc_test2.Computer,
jc_test2.GroupDomain, jc_test2.GroupName, jc_test2."Resource Type",
jc_test2.USERDomain, jc_test2.USERName FROM Altiris.dbo.jc_test2 jc_test2
WHERE (jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?) OR
(jc_test2.USERName Like ?) OR (jc_test2.USERName Like ?)
usr001 usr002 usr021 usr003 usr004 usr005 usr006 usr007 usr008 usr009 usr010 usr011 usr012 usr013 usr014 usr015 usr016 usr017 usr018 usr019 usr020 usr025 usr026 usr027 usr028 usr029 usr030 usr021 usr001 usr002 usr021 usr003 usr004 usr005 usr006 usr007 usr008 usr009 usr010 usr011 usr012 usr013 usr014 usr015 usr016 usr017 usr018 usr019 usr020 usr025 usr026 usr027 usr028 usr029 usr030 usr021
-9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9
Access Access_Type Computer GroupDomain GroupName Resource
Type USERDomain USERName