Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limiting The Returned Query Results through VB&SQL

Status
Not open for further replies.

Fubear

IS-IT--Management
Sep 11, 2002
299
GB
I have a form which the user uses to select the type of report they wish to view, from this form they can select the filter to use for the report as well.

One of these filters is "Select top X results"

I know the SQL to do so is "SELECT TOP X..." but I dont know how to insert this into the query (I't a complex Access Query, not coded into the VB), as the function to select the query for the report only allows me to add a custom WHERE statement.

Any help appreciated on this one - its driving me up the wall.
 
You could investigate using a 'in' subquery type where clause

where yourkeyid in(select top 100 yourkeyid from yourtable order by therelevantsortfield)

Andy

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top