Display the First 10 records of a Query/Report only 
Author Message
 Display the First 10 records of a Query/Report only

Hi,

Can anyone tell me an SQL or Visual Basic code that will
allow me to display only the first 10 records of a query
in a report?  Let's say the query returns 88 records, but
I only want to display the first 10 records (yet I don't
want to run another query to filter the others out).  
There's got to be a way without creating temporary tables,
etc. right?  Can someone lead me in the right direction?  
Is there VB or SQL code I shoule be using?  Thanks!



Mon, 05 Jan 2004 05:56:49 GMT  
 Display the First 10 records of a Query/Report only
Chris,

You can use the TOP keyword in the select statement.

SELECT TOP 10 columns FROM table...

Ted McNeal


Quote:
> Hi,

> Can anyone tell me an SQL or Visual Basic code that will
> allow me to display only the first 10 records of a query
> in a report?  Let's say the query returns 88 records, but
> I only want to display the first 10 records (yet I don't
> want to run another query to filter the others out).
> There's got to be a way without creating temporary tables,
> etc. right?  Can someone lead me in the right direction?
> Is there VB or SQL code I shoule be using?  Thanks!



Mon, 05 Jan 2004 07:30:15 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Display records 10 by 10

2. Jet engine loses 10 records when first opening an Access 97 database

3. Select first 10 records in SQL Server 6.5?

4. Numbering the values in a Top 10 query from 1 to 10

5. Crystal Data Objects - Only First 10 Rows Accessible

6. MSHFlexGrid displays first 2000 records only?

7. first record in query dumped when wrapping DataBind in While DataReader.Read() block

8. Adding new records without querying first

9. How to display 10 results at a time?

10. Reading a large Image (4-10 MB) and display sections with bitblt

11. Access queries run from VB gobbling 10 times the disk spaces as when run locally

12. Sybase system 10 param queries

 

 
Powered by phpBB® Forum Software