Formate Currency with 0 amount

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an ASP page that has four separate DRW regions that give me sum
results for a date range accounding to departments. It works great. My
problem is I have the total figure formated for currency with the following
code:

<%=FormatCurrency(FP_FieldVal(fp_rs,"extended"))%>

If I run the page for a short date range, one of the departments may not
have any sales so it should have a 0.00 amount but using the above code gives
me an error.

Type mismatch: 'FormatCurrency'

How can I still see $0.00 and not get this error?

Thanks.
 
Make sure that fields used, have a zero in them in the database.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
It is doing a sum for that date. The thing is, for that day, there might not
be a sale so no record in the database exists at all. So because I'm using
the currency format code to get that error. What is happening is the DRW is
posting the results for that day (which has no data) which is then formatting
to currency and producing the error. Is there a way to tell it not to format
currrency if no data or something like that?

Thanks.
 
Ok, then you need to create a EOF (End of File) test to make sure there are records before trying to
output the records. Since you are using the DRW, you will need to wait for someone else to respond
that uses the DRW.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
Wrap the DatabaseResultColumn bot in some script that checks to see if it
has a value. Switch to HTML view, add the script, and save your change while
you're still in HTML view.


<% If fp_rs("extended") > "0" then %>

DatabaseResultColumn Stuff here

<% End If %>
 
Can you be more specific? I tried what you suggested and no luck. I must be
doing something wrong.
 
here's an example - it's a copy and paste from one of my sites, so the
fieldnames are differest:


<% If fp_rs("Municipality") > " " then %>


<li><b>Municipality:</b> ­<!--webbot bot="DatabaseResultColumn"
startspan


s-columnnames="ProgramArea,Rec­ordNum,Date,ItemNumber,SplitIt­em,Session,PA­_SA
,ActNumber,Section,Recipient,M­unicipality,FundsUse,DollarFie­ld1,DollarFie­ld2
,DollarField3,DollarField4,Any­_Previous,DollarField5,FundNum­,AgencyNum,SI­D,P
roject_Num,Description"
s-column="Municipality" b-tableformat="FALSE" b-hashtml="FALSE"
clientside
preview="<font
size="-1">&lt­;&lt;</font>Municipa­lity<font
size="-1">&gt­;&gt;</font>" b-makelink
b-MenuFormat --><%=FP_FieldVal(fp_rs,"Munic­ipality")%><!--webbot
bot="DatabaseResultColumn" endspan i-checksum="33247" --></li>


<% End If %>


--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
web: http://www.spiderwebwoman.com/resources/
 
Back
Top