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

  • Thread starter Thread starter GIS IME
  • Start date Start date
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
 
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
 
Back
Top