SELECT TOP 1000 not working - returns 1173 results with ORDER BY

G

GIS IME

SELECT TOP not working

Hi,

I have patched Access 2003 and XP SP2 but when I run a select TOP
with:

SELECT TOP 1000 ID FROM [MyTable] ORDER BY [Application Date] DESC


I get 1173 results!!

However, if I take out the "ORDER BY" I get 1000 results - can anyone
help as I want to alert the user if their query tripped the max.

Regards,

Crispin
 
D

Duane Hookom

69 Camaro is most likely correct. To resolve the issue, add your primary key
or other field to the ORDER BY.
SELECT TOP 1000 ID FROM [MyTable] ORDER BY [Application Date] DESC, ID DESC;

--
Duane Hookom
MS Access MVP
--

'69 Camaro said:
Hi.

The 173 extra records are the results of ties.

HTH.

Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address, so that a message
will be forwarded to me.)


GIS IME said:
SELECT TOP not working

Hi,

I have patched Access 2003 and XP SP2 but when I run a select TOP
with:

SELECT TOP 1000 ID FROM [MyTable] ORDER BY [Application Date] DESC


I get 1173 results!!

However, if I take out the "ORDER BY" I get 1000 results - can anyone
help as I want to alert the user if their query tripped the max.

Regards,

Crispin
 

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