Another Where clause problem

qdogfball

Registered User.
Local time
Today, 08:55
Joined
Jul 24, 2007
Messages
65
I probably just need to put my glasses on, but I cannot figure this out!

I am trying to gather 5 of each associates records and put them into another table.

The table temp gets randomized. It also has around 40,000 records.

There are 36 associates in tblAssociates.

Code:
    strSQL = "SELECT TOP 5 * INTO tblTempAuditWork " & _
             "FROM tblTemp " & _
             "WHERE tbltemp.USR_NME IN(SELECT ID FROM tblAssociates)" & _
             "ORDER BY tblTemp.RandomNumber;"
 
You won't end up with a space between the subquery and "ORDER...".
 
Haha!

Well that solved getting some information.

But, I only got 5 records total, not 5 from each associate.

36 associates * 5 records = 180 total records.

Would I have to step through the tblAssociates in a DO LOOP?
 

Users who are viewing this thread

Back
Top Bottom