Puzzling probelm when re-arranging query columns

LarryJ

Board Regular
Joined
Mar 25, 2002
Messages
60
I have a student that has re-arranged the columns (drag & drop) in the datasheet view of his query, such that the columns are no longer in the order that they are in the query design grid.

Now, he would like to add a new column, in front of one of the columns on the datasheet. So, he adds it infront of the specific column in the design grid, but it does not show up in front of the same column in the datasheet view. Not too surprising since he moved columns around.

Now he would like to sync the datasheet and design views, moving the columns in the design view instead (as I had suggested in class). The problem is, we can't get the two views to sync up again.

Even if we put the datasheet view columns back in the order they are in design view, when a new column is added in design view, it does not show up properly in datasheet view.

Can anyone explain this to me?

I told him to just recreate the query, but I would like to know why this happens and if there is a way to sync them back up.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
SQL

Hi,

I believe the order of your displayed fields in the datasheet view, and the order in design view are independant of one another. The real heart of the query is its SQL equivelant, which can be acquired by selecting view|SQL when in the query. This SQL has no reference to the order in which the columns are displayed in datasheet view, so, its purely cosmetic.
To get your columns in the order they are in when viewed in design mode, select SQL view, cut out the SQL expression, start a new query, go to SQL view, and paste down the SQL. Now when viewed in datasheet view, you should see your columns in the same order of the design view. This should be much easier than rebuilding the query in design view.

HTH,
 
Upvote 0

Forum statistics

Threads
1,221,497
Messages
6,160,152
Members
451,625
Latest member
sukhman

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