score query

qaccess

Registered User.
Local time
Yesterday, 19:34
Joined
Aug 7, 2004
Messages
29
I have a question.

I have a query contains two columns one home one away.
evertime i insert a goal in the table it gives 1 or 0

home away
1 0
0 1
1 0

now i need this

home away
1 0
1 1
2 1

every next record looks to previous record and count it

does someone know how to do this.

ThanXs
 
You can add an autonumber field in the table and use the DSum() function in your query to get the totals. See query in the attached database.


Note
DSum() is not an efficient function if the table is large. With a large table, you may consider adding two total fields to it and using VBA to update the total fields.
.
 

Attachments

ThanXs Jon

Jon thanks I will look at it. I use this database for a website. With repeat region from dreamweawer I get it to work. I put a little code between it


While ((Repeat1__numRows <> 0) AND (NOT scoreverloop.EOF))


home = home + (scoreverloop.Fields.Item("home").Value)
away = away + (scoreverloop.Fields.Item("away").Value)


Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
scoreverloop.MoveNext()
Wend
 

Users who are viewing this thread

Back
Top Bottom