Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sequence Number changing

Status
Not open for further replies.

Hokis

Technical User
May 21, 2007
51
US
HI,
I have a huge problem & I don't know where it comes from.
I have a dbf file that has a text property field, which has a sequence number 1 to 60000 in it. when i import that file in Access, it rearange that sequence nuymbers randomely, it's not changing the properties or anything but it is changing the seq. numbers. But when i export it, it is exporting it just fine (in sequence.) what is wrong with this picture. How can i keep my sequence number in order in access, without going in & changing it's properties to Numeric.???
Thank you.
H.
 
yes, exactly that's what i mean.
 
is it realy random
2
5
39
7
100
23
59
....


or is it

1
11
111
112
113
114
115
116
117
118
119
1111
 
does it matter what the order is in the table? if so you can write a query that puts it in order if you need to see if that way.....a table is like a bag of marbles...there is NO order. Only if you write a query and declare the order will you get records in order.

Does that make sense?



Leslie

Have you met Hardy Heron?
 
it is really random , like 4- 5 - 7 - 10-25...etc
 
No lespaul, it I didn't get what you said, but yes the order is very important as it is a mailing list that has sequence number in it, & to sort the mail you have to put it in order. so i need my numbers to stay AS IS.
 
Select sequence
from table
order by val(sequence )
 
Sounds like you are sorting on a text field. So this goes character by character Like:
sequenceText
1
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9

Make a query and take the val of the text and sort on that field

SELECT
tblTest.sequenceText,
Val([sequenceText]) AS sequenceNumber
FROM tblTest
ORDER BY Val([sequenceText]);
 
actually i needed it to be in order when i import it without me going in & re-index it.
But u know what i got it.
in the Tools-Options, Table/Queries, there is an option that when u import it is indexing on specific key names, like ID, Num, Key, so it is reindexing the file accordingly. So once that i took off those names, it started to import it in the sequence that i want (the right one). glad that i found the reason.
But hey thanks anyways. I appreciate your time.
 
I don't think you've really solved your problem, it only appears like it. Sooner or later, you will find the "default" sort order is not as you expect.

As others have explained, database records don't have a "default" order. They are not like spreadsheets. The only way to guarantee an order is to write a query with an ORDER BY clause.

Whatever report, form, or code relies on it to be in a certain order, simply base it on a query rather than the table.

Joe Schwarz
Custom Software Developer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top