469,927 Members | 1,369 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Creating a summary table for a yes/no page vote

Hi, Im trying to create a summary page for a vote on pages in ASP.Net and having trouble writing the SQL to do this.

Each page has a "was this helpfull YES or NO" which when an option is chosen the result saved into a database table along with a numerical ID for the page and the section of the site that the page is in.

On the summary page it needs to add up all the yes votes and no votes and tally them up next to there page in each section.

Thank you
Nov 23 '07 #1
2 926
nateraaaa
663 Expert 512MB
Are you saving the selection as a bit field or a char field in your database table?

Nathan
Nov 23 '07 #2
All the variables are saved as numbers, so each area and page has a number reference and the votes are saved as a number variable as well 1 for yes and 0 for no.

Something like this;

Area Page Vote
1 1 1
1 2 1
4 1 0
2 2 0
2 2 0
1 1 1
3 3 1
4 1 0

In the summary this would be counted and sorted like bellow

Area Page Yes No
1 1 2 0
1 2 1 0
2 2 0 2
3 3 1 0
4 1 0 2
Nov 23 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by Andrew Westgarth | last post: by
reply views Thread by msnews.microsoft.com | last post: by
3 posts views Thread by Brian Cryer | last post: by
2 posts views Thread by rodchar | last post: by
4 posts views Thread by Nathan Benefield | last post: by
4 posts views Thread by tshad | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.