Formatting an IIF expression in a query to be percent

C

coastal

In a query I have:
Rate: IIf([PPC Imp]=0,"NA",[PPCF])
Where the field [PPCF] is a caltulated field that out puts a percentage rate
and [PPC Imp] is the denominator of that calculation.

So if the denomiator is zero then result should be "NA" and if not then
result should be the percentage rate.

Problem is in the format of the output of the percentage. I am getting:
3.52148103430929E-02 instead of 3.52%.

In the properties of that filed, the format types are not avaialbe so I
typed in "##.##%" and still no go.

Please advise. Thanks!
 
O

Ofer Cohen

Try using the format inside the IIf

Rate: IIf([PPC Imp]=0,"NA",Format([PPCF],"#.##%"))
 
C

coastal

Thanks that did the trick!
--
--coastal


Al Camp said:
Coastal,
Try...
Rate: IIf([PPC Imp]=0,"NA",Format([PPCF],"#.00") & "%")

--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


coastal said:
In a query I have:
Rate: IIf([PPC Imp]=0,"NA",[PPCF])
Where the field [PPCF] is a caltulated field that out puts a percentage rate
and [PPC Imp] is the denominator of that calculation.

So if the denomiator is zero then result should be "NA" and if not then
result should be the percentage rate.

Problem is in the format of the output of the percentage. I am getting:
3.52148103430929E-02 instead of 3.52%.

In the properties of that filed, the format types are not avaialbe so I
typed in "##.##%" and still no go.

Please advise. Thanks!
 
C

coastal

Great! Thanks!
--
--coastal


Ofer Cohen said:
Try using the format inside the IIf

Rate: IIf([PPC Imp]=0,"NA",Format([PPCF],"#.##%"))

--
Good Luck
BS"D


coastal said:
In a query I have:
Rate: IIf([PPC Imp]=0,"NA",[PPCF])
Where the field [PPCF] is a caltulated field that out puts a percentage rate
and [PPC Imp] is the denominator of that calculation.

So if the denomiator is zero then result should be "NA" and if not then
result should be the percentage rate.

Problem is in the format of the output of the percentage. I am getting:
3.52148103430929E-02 instead of 3.52%.

In the properties of that filed, the format types are not avaialbe so I
typed in "##.##%" and still no go.

Please advise. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top