Select Top Syntax Error

  • Thread starter Thread starter Len
  • Start date Start date
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
 
Back
Top