Select Top Syntax Error

L

Len

Hi Guys;

I have an ACCESS Table with an unknown number of students. I want to select
the top one seventh of the students or 14.2857 %, but I am having trouble
with the code below.

intGroup = intTotRecords/7

Set rstFedClass = db.OpenRecordset("SELECT TOP intGroup FedClass. * FROM
FedClass ORDER BY TotPotPlyrs DESC")

It works when I say TOP 1613 or TOP 14 Percent, but not when I use the
variable of intGroup.

Does anyone know the proper syntax?

Thanks a Lot for the help in Advance.

Len
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top