APPENDING TO A TABLE WITH DATA

H

hois

When I append (using an append query) data to a table with existing data it
does not append the data in the exact same sequence as it was in the source
table. It seems like this occurs as I am appending data to the table multiple
times.
Is there anything I can do to force the sequence to remain as it was in the
original table.
Thanks --
Hois
 
D

Dirk Goldgar

hois said:
When I append (using an append query) data to a table with existing data
it
does not append the data in the exact same sequence as it was in the
source
table. It seems like this occurs as I am appending data to the table
multiple
times.
Is there anything I can do to force the sequence to remain as it was in
the
original table.


Data in a table is not inherently ordered. Normally, Access presents it in
order by primary key, but that's just because it is convenient for Access to
do it that way -- there's no rule or principle that says it should. And in
the absence of a primary key, and with no order defined by an ORDER BY
clause, you shouldn't have any expectations about the order of records.

Any time you care about the order of records, use a query to explicitly
order them. And if there is no field by which records can be ordered the
way you want, then you need to add one somehow.
 
L

Larry Linson

Relational tables are, by definition, UNordered. That is, tables have no
inherent sequence. To get data in a sequence you use a Query (specify Sort
if you use the Query Builer, use an ORDER BY clause if you write the JCL),
but don't rely on there being any predictable sequence to table data.

Larry Linson
Micrososft Office Access MVP
 
D

Duane Hookom

Records in a table have no order. You might force the append order if your
append query uses an ORDER BY. Is there a good reason why you think the
records need to be in order?
 
G

George Hepworth

Records within Tables in a relational database have no inherent order.

A bucket is an apt metaphor for tables. You dump records in in any order you
wish, but once they're there, they're free to slosh around as they please.

The way to IMPOSE a sequence, or sort order, on a table, is to select one or
more the fields in the table and apply a sort order to the selected
field(s). For example, you might have a date field, which can be sorted from
oldest to newest, or from newest to oldest. But, the order in which those
records were orginally appended to the table is, in itself, of no
consequence.

If the order in which you view records is important for a particular report
or operation, then, pick a field, or add one to your table, and use the
values in that field to sort on.

By the way, an important consequence of this fact about tables is that there
is not inherent importance to the relationship between any given record and
the records "before" and "after" it. Those records fall in that sequence
ONLY because of the particular sort applied at that moment and that
sequencec can be reversed or even displayed by applying a different sort on
the table.

HTH

George
 

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