asp database count script!

Associate
Joined
8 Oct 2006
Posts
379
Location
Leicester
hi, i'm looking for a script that will run in asp that checks a database, and count how many times people have selected a certain value. i.e. "blue"

i think i might have an idea how to do this, but i also need it to not count multiple choices from the same person. i.e. if person A chooses Blue on day 1 but on day 2 he changes to orange and submits it in a form to the database. This will mean person but i just need to check the final one!

thanks.
 
it's a database with the following fields:

id_number
position1
position2
position3
position4
date
time

I need to check how many of each name there is (i.e. 5 x John Doe in position 2) but if say a person with ID 1234567 submits twice, only the last submisstion should count.

thanks a lot. :D
 
hi, well the date and time are only there for my personal use, there is also an (AutoNumber) field called ID which everything is indexed by, that will determine which is the latest. sorry i forgot to mention that!
 
thanks, ok so that will count the number of each right (if i followed it correctly!!) what is the output variable then? so i can display like this:

Votes per peron:
Position 1:
Person 1 = 5 votes
person 2 = 3 votes

Position 2:
Person 3 = 3 votes
etc

sorry if i'm just being stupid but i really can't see it!!

(or does this make a new table with just the latest vote from each person??)
 
Last edited:
Back
Top Bottom