Hi,
I have an SQL statement:
SELECT DISTINCT Tests.ConfigName, Tests.[C-SEL] FROM Tests WHERE Tests.OSID = 1 AND Tests.DriveType = 1
Now, this is working fine, but the order that the records are returned in is not correct. I want it to return the records in the order they were entered into the database (thought that was the default), but they are being returned alphabetically. The field Tests.ConfigName is not indexed. The only field in the Tests table that is indexed is the LogID field, which is autonumbered.
So, I changed the SQL statement to read
SELECT DISTINCT Tests.ConfigName, Tests.[C-SEL] FROM Tests WHERE Tests.OSID = 1 AND Tests.DriveType = 1 ORDER BY Tests.LogID
This is not working either. It is giving me the error:
Run-time error '-2147467259(80004005)':
ORDER BY clause (Tests.LogID) conflicts with DISTINCT
So, my question is, how can I order them correctly?
Thanks,
Elena
I have an SQL statement:
SELECT DISTINCT Tests.ConfigName, Tests.[C-SEL] FROM Tests WHERE Tests.OSID = 1 AND Tests.DriveType = 1
Now, this is working fine, but the order that the records are returned in is not correct. I want it to return the records in the order they were entered into the database (thought that was the default), but they are being returned alphabetically. The field Tests.ConfigName is not indexed. The only field in the Tests table that is indexed is the LogID field, which is autonumbered.
So, I changed the SQL statement to read
SELECT DISTINCT Tests.ConfigName, Tests.[C-SEL] FROM Tests WHERE Tests.OSID = 1 AND Tests.DriveType = 1 ORDER BY Tests.LogID
This is not working either. It is giving me the error:
Run-time error '-2147467259(80004005)':
ORDER BY clause (Tests.LogID) conflicts with DISTINCT
So, my question is, how can I order them correctly?
Thanks,
Elena