By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,479 Members | 988 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,479 IT Pros & Developers. It's quick & easy.

Sorting in a db table

P: 1
Hi
i wonder can you help me. i am using office 2003 access and when i am creating my database table the first column sometimes becomes sorted in alphabetical order. I need entries to be in the order they are inputted,. is this possible?
Dec 7 '06 #1
Share this Question
Share on Google+
2 Replies


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi
i wonder can you help me. i am using office 2003 access and when i am creating my database table the first column sometimes becomes sorted in alphabetical order. I need entries to be in the order they are inputted,. is this possible?
You need a numeric primary key on your table. Probably an autonumber.

This will default to records being sorted in the order they are inputted. However, there is no guarantee and when using the table I would always use a query as follows:

Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM TableName ORDER BY PrimaryKeyField;
  2.  
Mary
Dec 7 '06 #2

NeoPa
Expert Mod 15k+
P: 31,602
It is possible, but should be treated with caution.
To do it you need a table with no keys at all.
This will then keep the data in the order originally entered.
I have had to do that in the past due to requestor's requirements but it tends to cripple the engine (for large tables at least).
Dec 7 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.