0

Whats up Daniwebbers, heres my issue:

I gotta .asp file, opened it up in VS2010. The report is having an issue with totaling up a column and displaying it. The report generates perfectly, but when I look at the USED TOTAL cell at the end of the report, it is displaying #####.
This seems unusual as the report worked previously and the cell is stretched from the middle of the screen all the way to the right. But here is the code for the table that holds the USED COUNT total and the USED TOTAL(USED COUNT = how many people; USED TOTAL = sum up everyones value and display):

<table border="0" align="center" cellpadding="0" cellspacing="0" 
        style="width: 755px">
  <tr>
    <td><div align="right" class="style10">
      <% response.write "Credit Count: " & i %>
    &nbsp;</div></td>
    (I THINK MY ISSUE IS WITH THE CODE BELOW)
    <td> <span class="style10">&nbsp;          
      <% response.write "Credit Total: " & FormatCurrency(varCreditTotal*-1,2) %> 
    </span></td>
  </tr>
</table>

If anyone can enlighten me on this issue I would greatly appreciate it as I am not an HTML expert but came here to collaborate the issue with you guys:) Thanks in advance.

2
Contributors
7
Replies
8
Views
5 Years
Discussion Span
Last Post by SyncMaster170
0

What is the output of the following:

<% response.write "Credit Total: " & varCreditTotal %>

And this:

<% response.write "Credit Total: " & varCreditTotal*-1 %>

Since I don't think there's something wrong with the FormatCurrency function, maybe varCreditTotal is not declared properly?

0

As I rarely have to mess around with .asp files, I am not forshore on that, but will mess around to it when I get back on that subject and will report back. However, do you know what the asterisk means(varCreditTotal* -1)?

0

The output of the following

<% response.write "Credit Total: " & varCreditTotal %>

And this:

<% response.write "Credit Total: " & varCreditTotal*-1 %>

still produces this : #####

:(:( WTF is going on?

0

Okay, I have never played around with any ASP.NET before, but I'm pretty sure now that varCreditTotal is not declared properly (meaning that it is set to null or NaN or something like that). Is varCreditTotal a variable that is created somewhere in your code? If so, could you post that piece of code aswell?

0

Heres my vars that are relevant:

dim sql
        dim sql2
        dim varLastAccountID
        dim varCurrentAccountID
        varLastAccountID=0

        dim i 
        i=0

        dim varCreditTotal
        varCreditTotal = 0

Set rs = Server.CreateObject("ADODB.Recordset")
        rs.ActiveConnection = conn



while not rs.eof



If rs("Amount")<>0 Then
                varCreditTotal =varCreditTotal + rs("Amount")
                i=i+1
            End If
0

Thanks! Are you sure that varCreditTotal is visible to the part where you are getting problems? What happens if you place response.write "Credit Total: " & varCreditTotal right under the line varCreditTotal =varCreditTotal + rs("Amount")?

0

thats not feasible as this .asp file totals a members credits and adds them all up to display the total. So if I did that it would simply just add the current members credits, then display it as the total. This line of code:

varCreditTotal =varCreditTotal + rs("Amount")

adds up the total credit amount for all members. It cycles through the database to get a Total Credit Amount, then its suppose to display the TOTAL at the end. But I might give it a shot if all else fails and I am still getting no where with this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.