Disable Alphabetical Auto-Sort

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a main data table with four fields: ID (autonumber), KEY (alphabetical
abbreviation, ie - MERTRD_EX_CUR, or ABS_CAN), DATE, and VALUE. Therefore,
some keys may have 1000 or so actual records. The KEY's were entered in a
specific order, so that I could produce a table similar to the one I update
from.

However, when I run a query to select distinct keys it automatically
alphabetizes them, even though I entered no ORDER BY statement. As such,
the linked tables grouping the data into ITEMS and TABLES (each with their
relevant information) has the keys stored in the wrong order.

I'd like to avoid going through the main data table and assigning each
concurrent key with its own number as this would take some time. Is there a
way to query the distinct keys from the data table and maintain their
original ordering??

Thanks in advance,
 
I have a main data table with four fields: ID (autonumber), KEY
(alphabetical
abbreviation, ie - MERTRD_EX_CUR, or ABS_CAN), DATE, and VALUE.
Therefore,
some keys may have 1000 or so actual records. The KEY's were entered in a
specific order, so that I could produce a table similar to the one I
update
from.

However, when I run a query to select distinct keys it automatically
alphabetizes them, even though I entered no ORDER BY statement. As such,
the linked tables grouping the data into ITEMS and TABLES (each with their
relevant information) has the keys stored in the wrong order.

I'd like to avoid going through the main data table and assigning each
concurrent key with its own number as this would take some time. Is there
a
way to query the distinct keys from the data table and maintain their
original ordering??

maybe I don't fully understand , but...

qryDistinctKeys

SELECT
tbl.KEY,
Min(tbl.ID) As SortKeys
FROM tbl
GROUP BY
tbl.KEY
ORDER BY
Min(tbl.ID);
 
That worked perfectly...Thanks!!



Gary Walter said:
;

maybe I don't fully understand , but...

qryDistinctKeys

SELECT
tbl.KEY,
Min(tbl.ID) As SortKeys
FROM tbl
GROUP BY
tbl.KEY
ORDER BY
Min(tbl.ID);
 
Back
Top