Can't edit MSQuery

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,046
Office Version
  1. 365
Platform
  1. Windows
can anyone tell me how to get around this. i have a daily update that relies on MS Query to update figures in my main workbook. At the end of each day, i am to hit a button which updates historical sales data.

Problem arises only on Tuesday. Sure, the SQL of the query is different to each other day. However, try as i might, MS Query will not let me edit the underlying query. the sql for Tuesday and Monday (M, W, Th and Fri are all the same syntax).

MONDAY:

SELECT tbllastyr0021.Date, tbllastyr0021.ProductNo, Sum(tbllastyr0021.NetSaleLastYr) AS 'Net Sale'
FROM `I:\SHARED\Estimates\Estimates`.tbllastyr0021 tbllastyr0021
WHERE (tbllastyr0021.`CAT NO` In ('312','315','450','500','510','520','560')) AND (tbllastyr0021.CALWKNO=?)
GROUP BY tbllastyr0021.Date, tbllastyr0021.ProductNo


TUESDAY

SELECT tbllastyr0022.Date, tbllastyr0022.ProductNo, Sum(tbllastyr0022.NetSaleLastYr) AS 'Net Sale'
FROM `I:\SHARED\Estimates\Estimates`.tbllastyr0022 tbllastyr0022
WHERE (tbllastyr0022.CALWKNO=?)
GROUP BY tbllastyr0022.Date, tbllastyr0022.ProductNo, tbllastyr0022.`CAT NO`
HAVING (tbllastyr0022.`CAT NO` In ('312','315','450','500','510','520','560'))

I want to redo Tuesday's query so that it resembles the format and syntax of Monday - it just won't let me.

any suggestions?

ajm
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hi,

Are you able to click on the Edit Query button or is it disabled? Do you get any messages and if so, what is the exact message you get?

Dan
 
Upvote 0
G'day Dan,

Edit Query brings up the following message "This query cannot be edited by the query wizard".

If you then click on "OK" it takes you to an input box which is actually the first stage of the routine asking you for the week number. cancelling this then lets you change the query.

However, it wil not let me save any changes.

??

ajm
 
Upvote 0
OK, that's what I get. However, once you're in MS Query you should be able to click the SQL button and edit the SQL there. Once you've edited as you the SQL click OK - if you've specified a parameter in your query then it will prompt you to enter a value. Enter any old value. Your new query should hopefully then be displayed in the MS Query window....

If so, click File, Return Data to MS Excel and you're away.

Let me know how you get on,

Dan
 
Upvote 0
Dan,

Seems to have worked and is running ok. keep fingers crossed as we archive this folder weekly and begin again next week in the same spot.

Regs,

ajm
 
Upvote 0

Forum statistics

Threads
1,221,805
Messages
6,162,074
Members
451,738
Latest member
gaseremad

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