Count query

Kelly

Registered User.
Local time
Today, 00:02
Joined
Nov 5, 2010
Messages
11
Is there a simple code/function I can use to extract a record and show in the reference column every third number. Basically I am getting the results on my query by using SUM - First or Last, however I dont want to see them I want to see the third number how can I change this?

Please absolute beginner.
 
Send a short example of your MDB, table look, (Access 2000 or 2002-2003),
and say what do you want, (query result).
 
Need a clearer description. Do you mean you want every third record? How have you ordered your results?
 
My table looks like

District NRN North Dist LV ref lv cust affected Min Stage Time
TAY 003_ 005_ 010_ 06 0000274 12 30/05/2010 21:53:00
TAY 003_ 005_ 010_ 06 0000279 12 01/06/2010 06:43:00
TAY 003_ 005_ 010_ 06 0000282 12 02/06/2010 16:10:00
TAY 003_ 005_ 010_ 06 0000422 12 02/07/2010 23:58:00
TAY 003_ 005_ 010_ 06 0000426 12 04/07/2010 12:51:00
TAY 003_ 005_ 010_ 06 0000433 12 04/07/2010 17:52:00
TAY 005_ 003_ 010_ 01 0000699 36 07/09/2010 13:29:00
TAY 005_ 003_ 010_ 01 0000715 36 10/09/2010 08:05:00
TAY 005_ 003_ 010_ 01 0000724 36 11/09/2010 12:47:00
TAY 005_ 003_ 010_ 01 0000730 36 12/09/2010 00:49:00
TAY 005_ 003_ 010_ 01 0000845 36 12/10/2010 10:59:00
TAY 015_ 017_ 045_ 04 0000213 1 20/05/2010 12:53:00
TAY 015_ 017_ 045_ 04 0000251 1 27/05/2010 16:49:00
TAY 015_ 017_ 045_ 04 0000441 1 05/07/2010 15:49:00
Part of my table looks as above. I need a query which will extract all Ref numbers and show me the count and the third LV Ref.
This is the simplest but I need the record to show the third LV reference number instead of first or last. Can you suggest.

District NRN North FirstOfDist LV ref CountOfDist LV ref
TAY 003_ 005_ 010_ 06 0000422(would be 282) 6 12
TAY 005_ 003_ 010_ 01 0000715 5 36
TAY 015_ 017_ 045_ 04 0000441 3 1
TAY 025_ 017_ 010_ 04 0000790 3 15
TAY 033_ 011_ 005_ 02 0000214 6 36
TAY 033_ 014_ 025_ 05 0000807 4 22
TAY 033_ 015_ 005_ 08 0000049 3 6
 
Last edited:
Look at "DemoCountQueryA2002.mdb" (attachment, zip).
I think I quessed what you need.
Look at tables, queries (3 queries), module1 (2 functions), and Form.
Open Form1 and try. Adapt it in your mdb.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom