?
Solved

preserve order of the query

Posted on 2012-09-14
3
Medium Priority
?
378 Views
Last Modified: 2012-09-25
Hi.  Is there any way to keep fields in the query in certain order?

Issue: I need to keep resultset of the query in order colA, colB, colC, colD, colE, colf

Although SQL view list above listed order, resultshet displays columns in changed order
cola, colb, cold, colF, colE, colc
0
Comment
Question by:maximyshka
3 Comments
 
LVL 66

Expert Comment

by:Jim Horn
ID: 38399060
>Although SQL view list above listed order, resultshet displays columns in changed order
Show us.   Please copy-paste the query SQL, and a screen shot of the results, into this question.
0
 
LVL 85
ID: 38399073
What do you mean by "resultset"? Are you opening the query in the interface, or are you using it when opening a Recordset?

If you're using a Recordset, then the only way to insure the order of your columns is to specify the columns:

SELECT ColA, ColB, ColE, ColF, ColC FROM MyTable

Instead of

SELECT * FROM MyTable
0
 
LVL 52

Accepted Solution

by:
Gustav Brock earned 1500 total points
ID: 38400460
It is the property ColumnOrder of the fields that sets the order of the columns when you display a select Query.

The fastest way to reset it is to copy and paste the SQL into a new query.

/gustav
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question