Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
parameters | Excel Discussion (Misc queries) | |||
Unable to click on charts & unable to create any new charts Excel | Charts and Charting in Excel | |||
Too few parameters | Excel Programming | |||
too few parameters | Excel Discussion (Misc queries) | |||
too few parameters | Excel Programming |