get average every 5 records

qwkslvr1999

Registered User.
Local time
Today, 14:15
Joined
Jan 21, 2002
Messages
42
I have a table that looks like this:

SID..Field2(y/n)..Field3..Marker(Y/N)
1....-1...........85......0
1....-1 ..........21......0
1....-1...........12......0
1....-1...........28......0
1....-1 ..........15.....-1
1.....0...........21......0
1.....0...........13......0
1.....0...........44......0
1.....0...........12......0
1.....0...........52.....-1
2....-1...........19......0
2....-1...........25......0

An SID always has 10 records, first 5 records always has field 2 equals -1 and the next 5, equals 0. Field 3 can be any value. Marker is equal to -1 every 5th record.

I would like to create a query that will get the average of Field 3 every 5 records. How should I do it?

I hope I explained this clear enough. Thanks in advance!

[This message has been edited by qwkslvr1999 (edited 02-22-2002).]

[This message has been edited by qwkslvr1999 (edited 02-22-2002).]

[This message has been edited by qwkslvr1999 (edited 02-22-2002).]
 
If I understand you, you want to find the average of field3 for each unique combination of SID and field2.

Create a summary query with 'Group By' for each of your two fields, and 'Avg' for the Field3.
 

Users who are viewing this thread

Back
Top Bottom