Override Excel sort with SQL order by statement

DWig

Board Regular
Joined
Sep 26, 2012
Messages
77
Hello again.

I'm currently working on reorganizing a datatable in a fairly complex Excel application. The problem that I'm running into is this:

I have an ORDER BY clause in my SQL expression (Microsoft Query via an ODBC connection).

SELECT A, B, C, D
FROM some tables
WHERE some criteria
GROUP BY some nonsense
HAVING some more criteria
ORDER BY Region, State, Location, Submarket, Project

However, at some point in the several months this application has been in use, it has been sorted.

If I paste this into a new file, it returns the records in the correct order. However, the Excel table that we're using in the application only orders by Project. I can't get it to "refresh" and use the order by clause in the SQL query.

Any thoughts?

DWig
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,222,828
Messages
6,168,484
Members
452,193
Latest member
Arlochorim

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