sum of a row in a column (classic asp)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oxcor
    New Member
    • Jan 2018
    • 2

    sum of a row in a column (classic asp)

    hello,

    I have a problem with my classic asp page. I want to sum every data in a row when if pages changes. the column data is not in database. I have a formula in the page. I did that in page. but when the page changes it starts over. I need all total sum.
  • oxcor
    New Member
    • Jan 2018
    • 2

    #2
    <table width="100%" border="0" cellspacing="0" cellpadding="2" style="border-collapse:collap se ; border:#eaeaea 0px solid;">
    <tr bgcolor="<%=bgc olor%>" onmouseover="th is.style.backgr oundColor='#FFF FCC';" onmouseout="thi s.style.backgro undColor='';">
    <td width="5%">No</td>
    <td width="25%">Dat e</td>
    <td width="5%">Time </td>
    <td width="15%">Tra ck</td>
    <td width="10%">Odd </td>
    <td width="10%">Pro fit</td>
    <td width="10%">Tot al</td>
    </tr>
    </table>





    <table width="100%" border="0" cellspacing="0" cellpadding="2" style="border-collapse:collap se ; border:#eaeaea 0px solid;">
    <td>
    <%
    Set Conn = Server.CreateOb ject("ADODB.Con nection")
    Conn.Open "DRIVER={Micros oft Access Driver (*.mdb, *.accdb)}; DBQ=" & Server.MapPath( "/HR.accdb")
    Set Rs = Server.CreateOb ject("aDodb.rec ordSet")
    Sor = "Select * from ENGBet365 order by dor desc"
    Rs.Open Sor, Conn, 1, 3



    If Rs.EOF or Rs.BOF Then
    Response.Write "<script language='javas cript'>alert('N o Records!');</script>"
    response.Write "<meta http-equiv='refresh' content='1; URL=?part=engla nd'>"
    Response.End
    End If
    adet=Rs.RecordC ount

    rownumber=1

    syf = Request.QuerySt ring("syf")
    If syf="" Then
    syf=1
    End If

    Rs.PageSize = 20
    Rs.absolutepage =syf
    sayfa=Rs.pageco unt
    for t=1 to Rs.PageSize
    If Rs.EOF Then exit for
    if renk mod 2 Then bgcolor = "#FFFFFF" Else bgcolor = "#f7f7f7" end if
    %>








    <table width="100%" border="0" cellspacing="0" cellpadding="2" style="border-collapse:collap se ; border:#eaeaea 0px solid;">
    <tr bgcolor="<%=bgc olor%>" onmouseover="th is.style.backgr oundColor='#FFF FCC';" onmouseout="thi s.style.backgro undColor='';">
    <td width="5%"><%=r ownumber%></td>
    <td width="25%"><%= FormatDateTime( Rs("dor"),1)%> </td>
    <td width="5%"><%=F ormatDateTime(R s("tor"),4)%> </td>
    <td width="15%"><%= Rs("track")%></td>
    <td width="10%"><%= FormatNumber(Rs ("odd"),3)%> </td>
    <td width="10%" align="right">
    <%
    ROR = Rs("Result")
    If ROR = 1 Then
    Response.Write "<font color=red>"
    Response.Write ""&ROR&""
    Response.Write "</font>"
    Else
    Response.Write ""&ROR&""
    End If
    %>
    </td>
    <td width="10%" align="right">
    <%
    Set ATA = Server.CreateOb ject("aDodb.rec ordSet")
    Sor = "Select * from Settings"
    ATA.Open Sor, Conn, 1, 3

    ROR = Rs("Result")
    If ROR = 1 Then
    TOT = ATA("Lia")*(-1)
    Response.Write "<font color=red>"
    Response.Write FormatNumber("" &TOT&"")
    Response.Write "</font>"
    Else
    TOT = ATA("Lia")/((Rs("Odd"))-1)*FormatNumber (ATA("Commissio n"),5)
    Response.Write FormatNumber("" &TOT&"")
    End If

    ATA.Close
    set ATA=nothing
    %>
    </td>
    <td width="10%" align="right">

    <%
    total = total + tot
    Response.Write FormatNumber(To tal,2)
    %>

    </td>
    </tr>

    <%
    rownumber=rownu mber+1
    renk=renk + 1
    Rs.movenext
    next
    Rs.Close
    set rs=nothing
    %>
    </table>



    </td>
    </tr>
    </table>



    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collap se ; border:#eaeaea 0px solid;">
    <tr>
    <td class="grey_ter s">
    Page :
    <%
    for y=1 to sayfa
    If y=cint(syf ) Then
    Response.write (""&y&"")
    else
    Response.write "<span class=""beyaz"" ><a href='?part=eng land&syf="&y&"' > "&y&" </a></span>"
    End If
    next
    %>
    </td>
    </tr>
    </table>

    Comment

    Working...