Solved I want to return only the top three records

lbenjaminl

New member
Local time
Today, 07:19
Joined
Sep 28, 2022
Messages
8
I have a query that is defined by date and Activity Level. It excludes any Activity that has already been performed for the selected date. I get the right esults returned. I only want the first three records returned. Does anyone know how to do this?
 
The syntax for this is SELECT TOP 3 field1, field2, field3, ..., last-field FROM some-table WHERE selection-criteria ORDER BY something ;

The TOP 3 modifier is part of the answer. The OTHER part is that "TOP" implies that an order exists. Could be date, could be largest (or smallest) amount of something. Using TOP n without an ORDER BY will lead to confusing results.
 
SELECT TOP 3 * FROM (paste your Original Query here);
 

Users who are viewing this thread

Back
Top Bottom