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.

Calculate percentage from two recordsets

Discussion in 'C#' started by skwilliamson, Mar 24, 2006.

  1. #1
    I have two recordsets (rsWk) and (rsPvsWk) each pulling a different figure for the field (Mc). I have a separate space on the ASP within another table for logging the percentage increase/decrease between the two.

    Do I create a text box to display the data in the table?

    How do I create this calculation?
    SEMrush
    I'm not fluent in ASP so I may need help in positioning the code.

    Thanks.
     
    skwilliamson, Mar 24, 2006 IP
    SEMrush
  2. vectorgraphx

    vectorgraphx Guest

    Messages:
    545
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    something like this should work:
    <% av = rsWk("Mc")
    av2 = rsPvsWk("Mc")
    
    
    aver = (av2/av) * 100
    aver2 = (av/av2) * 100
    response.write "first percentage: " & aver &"%<br>"
    
    response.write "second percentage: " & aver2 &"%<br>"
    %>
    Code (markup):
    just write in your wording for "aver" and "aver2" wherever in your web page you wish to display it.

    VG
     
    vectorgraphx, Mar 24, 2006 IP