RecordCount and Math Operations in ASP

Posted on 2005-05-04
Last Modified: 2008-03-06
Dear Experts,

I hardcoded a number (Total) to subtract the recordcount from. Now, I want to use a number from a field instead so we can just change the total in the database instead of using a hardcoded number like I am using here...

dim Total
Total = 101              (I NEED TO MAKE 101 READ FROM A FIELD VALUE (rs.QTY) INSTEAD)
Response.Write "" & rs.RecordCount%>
<%Response.Write "" & CStr(Total -  rs.RecordCount)%>       (I TRIED RS.QTY HERE IT DIDNT WORK..)

Thanks Friends~
Question by:butter_fly
    LVL 15

    Expert Comment

    dim Total
    Total = 101              (I NEED TO MAKE 101 READ FROM A FIELD VALUE (rs.QTY) INSTEAD)
    Response.Write "" & rs.RecordCount%>
    <%Response.Write "" & CStr(Cint(Total) -  Cint(rs.RecordCount))%>
    LVL 15

    Accepted Solution

    It sound's like you want Total = rs("QTY").

    Author Comment

    That was it. I feel like a simpleton. haha =) Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video discusses moving either the default database or any database to a new volume.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now