Re: Format Numbers in IIF statement
- From: Marshall Barton <marshbarton@xxxxxxxxxx>
- Date: Fri, 30 Jun 2006 13:29:33 -0500
alecgreen wrote:
Hi, I am using the following IIF statement to calculate the percentage
difference between a Selling Price and a Order Selling Price, bearing
in mind you cannot deivide by zero!
OrdvsSell: IIf([SellingPrice]=0,"NO
CALC",(([OrderSellingPrice]-[SellingPrice])/[SellingPrice]*100))
However I cannot format the result to say 2 decimal places, instead of
the actual calculated result - Can this be done within the IIF
statement?
The problem probably is that the result is being converted
to a string because of the possible "NO CALC" result.
Try this:
OrdvsSell: IIf([SellingPrice]=0,"NO
CALC",Format(([OrderSellingPrice]-[SellingPrice])/[SellingPrice]),
"0.00%" )
--
Marsh
MVP [MS Access]
.
- References:
- Format Numbers in IIF statement
- From: alecgreen
- Format Numbers in IIF statement
- Prev by Date: Re: Querry in form
- Next by Date: Re: Format Numbers in IIF statement
- Previous by thread: Format Numbers in IIF statement
- Next by thread: Re: Format Numbers in IIF statement
- Index(es):