Table Export

J

Jeff

Hi,

I asked this question before but the answer turned out not to fix it.

Here is the problem

1.) I have a table in Access. The table has 4 columns and ~150,000 rows.
The table is sorted correctly (I mean how I want it sorted) in Access. So
the table might have diata like the following.

1, aa, zz, ks
2, bb, zz, kds
3, cc, zz, kds
...... (more rows).

2.) I export the table in Access to a csv. (Right click on table --> export
--> save as Table.csv)

3.) This is the problem - the table is not sorted the same way in the csv as
it is sorted in Access.

So the example table above might look like the following in the csv.

3, cc, zz, kds
1, aa, zz, ks
2, bb, zz, kds
...... (more rows).

The row starting with "3" is at the top now. So it is not "sorted" the same
way.

Does anyon know how to fix this?

Thanks
 
R

Roger Carlson

When you say the data is "sorted" in Access, it's not really. Access data
is never sorted on a physical level. When you sort it in the Access GUI,
you're just filtering it for display, not really sorting anything. In order
to get a sorted CSV file, you need to make a query of the table, sorted in
whatever way you want. Then export the query instead of exporting the
table.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
P

Paul S

In your spreadsheet, highlight the columns, click "Data" from the menu, then
"Sort".
 
J

John W. Vinson

Does anyon know how to fix this?

Yes. The answers you received in the other thread and rejected are the correct
solution.

You chose not to accept them. They're still correct.

If you export the Table, it will be exported in whatever unpredictable order
Access finds convenient - probably disk storage order, which might or might
not be in primary key order. Sorting the table view will not affect how the
data is exported.

If you do it correctly, by creating a sorted Query on the table and *exporting
that query*, you will get the desired result.

Use the tools Access provides - Queries - rather than insisting that your
incorrect perception must apply!

John W. Vinson [MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top