Home | Advertising Info760 USERS CURRENTLY ONLINE   
   Site Search Contact Us Sunday, August 14, 2022  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Scripting
 PowerASP Code Help Area : Classic ASP - Scripting
Subject Info: Format Currency A d d  -  P o s tAdd P o s t
Message << Prev Info | Next Info >>

Joined: March/08/2005
Online Status: Offline
Info: 2
Added: 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>

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

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

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2022 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 ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com