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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Querying every third record

Status
Not open for further replies.

rickorsteve

Technical User
May 20, 2004
3
0
0
US
I'm trying to query every third record from table a in order to add it to another table b.
I could use some help as soon as possible.
 
it is an excel file that i need to sort in access by every third name. I have given each record a numerical value ( 1-13000). Now I need to grab every third record 1-3-6-9-12 etc?
Any thoughts?
 
Yes... You will want to add this to the WHERE clause of the query...
Code:
([YourLineNumberField]/3 = Int(YourLineNumberField/3))
This will only choose rows that are evenly divisable by 3.

If you want to include row one as well. Just add another item that says:
Code:
Or ([YourLineNumberField] = 1)

Feel free to post your SQL Statement for help if you run into trouble.
 
Thnaks it worked like a charm.I appreciate your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top