Home | Advertising Info3 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Tuesday, May 14, 2024  

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Scripting
 PowerASP Code Help Area : Classic ASP - Scripting
Subject Topic: Format Currency Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
whobbs
Newbie
Newbie


Joined: March/08/2005
Online Status: Offline
Posts: 2
Posted: March/08/2005 at 2:37pm | IP Logged Quote whobbs

I need help formatting currency in this script, where and how do I format the result in the last column of the table. Thanks in advance for your help

 

adoConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & DBpath

promocode = REQUEST("promocode")
'
'************************************************
'
'
If Len(promocode)=0 then response.write "Sorry, there is no revenue for this affiliate"
Set Q1 = Server.CreateObject("ADODB.Connection") 'Initialize a DB connection object
Q1.Open adoConn 'Open the connection object
Set rsQ = Server.CreateObject("ADODB.Recordset") 'Open a recordset object
SQLx = "SELECT borrowerName, closingDate, loanAmount, adFee FROM t_revenue WHERE promocode='" & promocode & "'" 'Set the SQL command
rsQ.Open SQLx, Q1
Dataflag = NOT rsQ.eof
If DataFlag then aDB = rsQ.GetRows 'Read the recordset into an array variable
rsQ.close : Set rsQ=Nothing 'Close the recordset
Q1.close : Set Q1 = Nothing 'Close the DB
'
' Got the data, now build the table
'
TSum = 0
If DataFlag then %>

<%response.write("<p>Total Revenue for: " & request("promocode"))%><br>
<table border="1" cellspacing="0" cellpadding="0">
<tr><td bgcolor="#C0C0C0"><font face="Verdana" size="1" color="#000080"><b>Borrower Name&nbsp;</b></td><td bgcolor="#C0C0C0"><font face="Verdana" size="1" color="#000080"><b>Closing Date&nbsp;</b></td><td bgcolor="#C0C0C0"><font face="Verdana" size="1" color="#000080"><b>Loan Amount&nbsp;</b></td><td bgcolor="#C0C0C0"><font face="Verdana" size="1" color="#000080"><b>Advertising Fee&nbsp;</b></td><td bgcolor="#C0C0C0"><font face="Verdana" size="1" color="#000080"><b>Total Revenue&nbsp;</b></td></tr>
<% For I = 0 To UBound(aDB, 2)
Tresult = CCur(CDbl(aDB(2, I))*CDbl(aDB(3, I)))
TSum = TSum + Tresult %>
<tr><td><%=aDB(0, I)%>&nbsp;</td><td><%=aDB(1, I)%>&nbsp;</td><td><%=aDB(2, I)%>&nbsp;</td><td><%=aDB(3, I)%>&nbsp;</td><td><%=Tresult%>&nbsp;</td></tr>
<% Next %>
<tr><td colspan=5 align=right><%="Note: Decimal is 2 digits, Total Revenue: " & TSum %>&nbsp;</td></tr>

</table>
<% Else
response.write "Sorry, there is no revenue for this affiliate"
End If %>
</td>
</tr></td>
</tr>
</table>

Back to Top View whobbs's Profile Search for other posts by whobbs
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages what is asp programming how to sample asp example code scripts software asp forum mail sessions applications global.asa CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com