G
Guest
I have a IIf function in a query field that reads like so:
OAR: IIf([Net Operating Income]<>0 And [Sale Price]<>0,[Net Operating
Income]/[Sale Price],"N/A")
[Note: I am learning about the Nz function, but right now this coding,
though more complicated, simulates the same idea of making sure the involved
fields acutally have values...the default values in the table are currently
set to zero]
Here's my question: If possible, when the IIf condition is "true", I'd like
the mathematical calculation to be formatted as a percentage. However, I
think because I have the text "N/A" involved as my "false" value, the
Properties tab for the field is not letting me select any of the number
formats for my field (like Currency, percentage, etc.). I also cannot limit
the decimals returned by the calculation from the Field Properties tab.
My current solution has been to put a Round function on the calculation (2
decimal places) and then multiply the result by 100, then put the "%" sign
behind the figure in the report that runs off the query. Thus, my function
looks like this:
OAR: IIf([Net Operating Income]<>0 And [Sale Price]<>0,Round([Net Operating
Income]/[Sale Price]*100,2),"N/A")
Is there a function I can put on the [Net Operating Income]/[Sale Price]
calculation to have it expressed as a percentage without formatting the
entire field? Also, is there a similar function to express a calculation as
a currency?
I am using Access 2003, mdb file format.
Thanks-
Wil Loftis
OAR: IIf([Net Operating Income]<>0 And [Sale Price]<>0,[Net Operating
Income]/[Sale Price],"N/A")
[Note: I am learning about the Nz function, but right now this coding,
though more complicated, simulates the same idea of making sure the involved
fields acutally have values...the default values in the table are currently
set to zero]
Here's my question: If possible, when the IIf condition is "true", I'd like
the mathematical calculation to be formatted as a percentage. However, I
think because I have the text "N/A" involved as my "false" value, the
Properties tab for the field is not letting me select any of the number
formats for my field (like Currency, percentage, etc.). I also cannot limit
the decimals returned by the calculation from the Field Properties tab.
My current solution has been to put a Round function on the calculation (2
decimal places) and then multiply the result by 100, then put the "%" sign
behind the figure in the report that runs off the query. Thus, my function
looks like this:
OAR: IIf([Net Operating Income]<>0 And [Sale Price]<>0,Round([Net Operating
Income]/[Sale Price]*100,2),"N/A")
Is there a function I can put on the [Net Operating Income]/[Sale Price]
calculation to have it expressed as a percentage without formatting the
entire field? Also, is there a similar function to express a calculation as
a currency?
I am using Access 2003, mdb file format.
Thanks-
Wil Loftis