format line in properties is blank (1 Viewer)

ontplant

New member
Local time
Today, 13:11
Joined
May 6, 2008
Messages
3
In a query I made for a customer order report I have an IIf statement that calculates a fuel surcharge. I can't make it appear in the query or the report with the decimal. eg. it reads 2500 instead of 25.00. In the report I want to make that number currency in the format line but it's blank.

This calculation is a percentage of the delivery charge per load delivered. I have a second IIf statement calculation that is based on a specific amount charged per km to the customer location. This amount also will not show up as currency and the format line is blank as well.

I tried adding /100 at the end of the IIf statement for the percentage calculation but then any order that the surcharge is based on the per km amount won't open in reports.

any help with this would be much appreciated...I am a bit of a rookie with Access.
 

macca the hacke

Macca the Hacca
Local time
Today, 18:11
Joined
Dec 1, 2005
Messages
221
sounds as if access isn't recognising field as a number - are there values that are not numbers?? - Is the underlying field in the table set to be a number?
 

ontplant

New member
Local time
Today, 13:11
Joined
May 6, 2008
Messages
3
That's it exactly. My IIf statement is basically set like this:

IIf([fuelperKM]=yes,[priceperKM]*[TotalKM],"")

I took out the 'yes, no' field and it worked properly. The only problem is I have two scenarios for the fuel charge and if this particular one is not checked I don't want it to show up.

I'm at a loss as to how to make it work the way I need to and show up as currency...

many thanks for your reply.
 

macca the hacke

Macca the Hacca
Local time
Today, 18:11
Joined
Dec 1, 2005
Messages
221
Instead of taking out the yes/no field, why don't you just change your code at the top so that it sets blanks to 0 - ie:

IIf([fuelperKM]=yes,[priceperKM]*[TotalKM],0)
 

ontplant

New member
Local time
Today, 13:11
Joined
May 6, 2008
Messages
3
that did it!
many, many thanks!

I'm wondering though if there is still a way to have it not show up when the yes/no option is a 'no' which is what I was doing with the "". How could I have the currency show up when it is a 'yes' but have nothing show up when it's a 'no'?
 
Last edited:

Users who are viewing this thread

Top Bottom