Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Format Currency Not Working!!!

Status
Not open for further replies.

pcollins1

Technical User
Jun 19, 2002
72
US
Hello,
I want a field from database when returned to ASP page to display in Currency. I have tried FormatCurrency, but cannot get it to work. I would assume there is an easy way to display the data returned in Currency Format. Any help would be appreciated.

This is the error I receive.

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/AIR/results.asp, line 67

Response.Write oRec "FormatCurrency(Deposit_Amount,2)"
--------------------^

Here is the code:

Response.Write ("<CENTER><B><FONT SIZE=4 COLOR=Blue>Here is your Current Information.</FONT></B><P>")
Response.Write "<TR BGCOLOR=""#00ccff"">"
For i = 0 to oRec.Fields.Count - 1
Response.Write "<TH><FONT FACE=""ARIAL"" SIZE=""2"">" & oRec.Fields(i).Name & "</FONT></TH>"
Next
Response.write "</TR>"
' -- Now output the contents of the Recordset
oRec.MoveFirst %>
<%Do While Not oRec.EOF %>

<tr><td><% Response.Write oRec("Patient_Name") %></td>
<td><% Response.Write oRec("Date_of_Service") %></td>
<td><% Response.Write oRec("Claim_Number") %></td>
<td><% Response.Write oRec("Deposit_Date") %></td>
<td><% Response.Write oRec "FormatCurrency(Deposit_Amount,2)" %></td>
<td><% Response.Write oRec("Account_Number") %></td></tr>


<%
oRec.MoveNext
Loop
%>
<%
oRec.Close
set oRec = Nothing
oConn.Close
set oConn = Nothing
%>


</TABLE>
<p><small><a href="/Air/logoff.asp">Click Here to Logout</a></small></p>

</BODY>
</HTML>
 
Try this:
Code:
Response.Write FormatCurrency(oRec("Deposit_Amount"),2)

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Good catch Chopstik!

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Thanks, Chopstick It worked. Sorry it took so long to reply. I did not have the chance to make the change.

pcollins1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top