1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

ASP SQL (Sum) Help Needed

Discussion in 'C#' started by onestop, Feb 25, 2005.

  1. #1
    Hi everybody
    I need some help. I'm not good at ASP, and have a question. I've written an sql query to create txt output which displays the letters of alphabet in the first column, and total number of students whose names start with that letter in the second column. Something like this:
    How can I print the total number of students (sum) in ASP?
    I want to have the sum of 234, 879, 254, ...., 354 saying "total number of students = "..."
    any help is appreciated. I have to finish this urgent.
    thanks in advance
    onestop, Feb 25, 2005 IP
  2. J.D.

    J.D. Peon

    Likes Received:
    Best Answers:
    Trophy Points:
    Create a variable to store the total count and as you go through your result set in ASP, row by row, add the letter count to the total count (e.g. total = total + rs.Fields("letter_count")).

    J.D., Feb 25, 2005 IP