Export records in order

  • Thread starter Thread starter Dektolia
  • Start date Start date
D

Dektolia

Hi,

I'm trying to export either a query or table from Access 2003 to a fixed
length text file. The sort for the query or table does not stay in order for
the export. I've tried exporting from a sorted query (the sort criteria is
saved in the design properties) and I've tried making a table with the sorted
query and exporting that. In no case does it keep the sort order for the text
file export. My first choice would be to sort by fields that are not exported
but if the fields aren't displayed they are't used for the sort. Any help
would be appreciated.

Thanks
 
(the sort criteria is saved in the design properties)

To work as you wish the sort needs to be in the actual query or in the ORDER
BY clause of the SQL for the query.
 
That's where the sort is already - it's actually set in ORDER BY in the query
under properties. There are 2 fields listed to order by. I just went through
it with someone here to get a second set of eyes on it and everything he
thought to check I had already tried. The query is saved to sort in the
correct order, but it doesn't export that way. I even tried a make table
query to see if it would forget it's old order if it made a new sorted table,
but that's not the way it works. It still exports in the old order.

The only other information that might be helpful is I have an original
table, then I append records a couple times. It always exports with the
original records before any appended records and none of them in the sort
order.

Thanks for the suggestion. I was really hoping that was going to work for me
when I tried it yesterday, but it hasn't yet.
 
Are you talking about the order by in the properties where you right click on
the query while in design view then go to Properties? If so, that will not
work for an export. That's what I thought you meant by "Properties".
 
Thanks - I was in Design view. I added it in the SQL view and it's exporting
correctly.
 
Back
Top