View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
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