Parameters are not allowed in queries that can't be display

ftzeng

New Member
Joined
Mar 14, 2005
Messages
2
Until now, I have always used MSQuery to create queries with parameters, and then embedded the query into an Excel spreadsheet. This would allow me to anchor my parameters to certain cells on the spreadsheet. My report users could then change the values in those cells and click a button to refresh the query data. This works wonderfully with simple queries.

Now I have created a very complex query, specifically a query that uses a subquery as its SELECT FROM. When I try to set up my parameters in MSQuery for this query... it says "parameters are not allowed in queries that can't be displayed graphically." Without being able to put parameters in my query, I can't automate this using Excel.

Is there some other way to accomplish what I want to do?

Thanks,

Flora

Here is my SQL:

SELECT UM00163T.METER_NO, UM00100M.LOCATION_ID_CUSTOM, UM00163T.READ_DTM, UM00163T.READ_AMT
FROM UM00100M, UM00163T,
(SELECT UM00163T.METER_NO, MAX(UM00163T.READ_DTM) AS READ_DTM
FROM UM00163T
GROUP BY UM00163T.METER_NO)TEMP
WHERE UM00100M.LOCATION_NO = UM00163T.LOCATION_NO AND UM00163T.CYCLE_CD=?
AND UM00163T.METER_NO = TEMP.METER_NO AND
UM00163T.READ_DTM = TEMP.READ_DTM
ORDER BY UM00100M.LOCATION_ID_CUSTOM
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Do you actually need a subquery?

Why can't you use a Totals query?
 
Upvote 0
Thank you for your suggestion using Totals. I don't know how to write Totals, do you mind to rewrite the SQL for me so that I have a reference for future uses.

Thanks.

Flora
 
Upvote 0

Forum statistics

Threads
1,224,836
Messages
6,181,251
Members
453,027
Latest member
Lost_in_spreadsheets

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top