Let me add some notes on the TOP predicate as implemented in MS Access.

1. If you don't include an ORDER BY clause, a TOP N query will return an 
arbitrary set of N records that satisfy the WHERE clause.

2. You may get more than N rows from a TOP N query, since TOP does not choose 
between equal values.

-David

On Tuesday, April 10, 2001 3:41 PM, W Luke [SMTP:[EMAIL PROTECTED]] 
wrote:
>
> > Your ORDER BY field(s) should determine which records are returned; it
> your
> > example, you should be getting the 2 records with the highest end_date
> > value.
> >
> > If you order by ID, you'll get 2 records with the lowest (sorted
> ascending)
> > or highest (sorted descending) ID.
>
> So my code is correct then?
>
> I did see this mentioned a few weeks ago, but couldn't find it in the
> archives.
>
> > Is end_date in fact a date field?  Or is it perhaps text?
>
> Yes, it's a proper date field.
>
> Will

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to