Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unable to parameters in MicrosoftQuery

I have a quite large sql query that I want to use for fetching data i´nto an
Excel sheet. The query returns four columns and I want to use parameters for
two of these.

My problem is that my sql query cant be displayed grafically in
MicrosoftQuery and therefore I am not allowed to use parameters.

My question is: What determines if a sql question can be displayed grafically?

Pleas enlighten me.

Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Unable to parameters in MicrosoftQuery

I usually set up my querries by recording a macro while I manually perform
the query. then modify the recorded macro putting variables as required.

the trick in adding parameter is the query is one long string. You have to
break up the string into parts like this

querystring = "abcdefghijklmnop"

Variable1 = "def"
Variable2 = "ijkl"
querystring = "abc" & Variable1 & "fgh" & Variable2 & "mnop"


Look at the recorded query and see where the double ("") quotes are located
which indicates the beginning and end of the string.


"Captain Query" wrote:

I have a quite large sql query that I want to use for fetching data i´nto an
Excel sheet. The query returns four columns and I want to use parameters for
two of these.

My problem is that my sql query cant be displayed grafically in
MicrosoftQuery and therefore I am not allowed to use parameters.

My question is: What determines if a sql question can be displayed grafically?

Pleas enlighten me.

Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Unable to parameters in MicrosoftQuery

MS Query only allows for simple queries to be displayed. Anything more
elaborate than a simple Select/From/Where/GroupBy/Having/SortBy is not
supported. So if you have nested select statements or ... you are out of
luck. At that point you need to get into using VBA with an ADODB connection.
--
HTH...

Jim Thomlinson


"Captain Query" wrote:

I have a quite large sql query that I want to use for fetching data i´nto an
Excel sheet. The query returns four columns and I want to use parameters for
two of these.

My problem is that my sql query cant be displayed grafically in
MicrosoftQuery and therefore I am not allowed to use parameters.

My question is: What determines if a sql question can be displayed grafically?

Pleas enlighten me.

Mike

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
parameters DavidC Excel Discussion (Misc queries) 3 October 12th 09 06:48 PM
Unable to click on charts & unable to create any new charts Excel Snapclick Charts and Charting in Excel 4 February 1st 09 07:59 PM
Too few parameters lou sanderson Excel Programming 1 January 13th 06 06:35 PM
too few parameters lou sanderson Excel Discussion (Misc queries) 1 December 14th 05 07:53 PM
too few parameters lou sanderson Excel Programming 1 December 14th 05 07:53 PM


All times are GMT +1. The time now is 09:35 AM.

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"