Hello Richard, this is how I learn about IIF from your Access Expert 8. I'd like to share with you and the class.
We use decimal comma in general arithmetic. So the "IsTaxable" value 8% is written as = 0,08 instead of 0.08
The problem is, if I write IIF([IsTaxable],[ExtPrice]*0,08,0) then access will warn me for syntax error. So I replaced 0,08 with 8/100.
IIF([IsTaxable],[ExtPrice]*8/100,0) well it works partially for the TRUE-part. The FALSE-part show NULL (blank) instead of 0 (zero).
When I recheck the function, somehow it turns into IIF([IsTaxable],[ExtPrice]*8/100) See? the False-Part simply disappears. {IIF(Condition,True,False)}
I then realize, that Access assumes the last {,0} not as the {False-Part}, but as a part of {100,0} = 100.
So i modified the IIF function into IIF([IsTaxable],8/100*[ExtPrice],0) Now it works perfectly as expected, although I'm not sure if it is the ideal solution for the case. Another solution that works is, when I put 0,08 inside a bracket IIF([IsTaxable],[ExtPrice]*(0,08),0)
What will be the more elegant solution for this case? Do you have any tips about how MS Access handles comma and point as decimal marks? I'm afraid, my database will behaves differently on the other half of the world if there is no agreement about this simple issue :D
Reply from Richard Rost:
I really know very little about how other currencies are handled in Access. My experience is limited to the US and Canada. If putting the currency value inside of parentheses works, I'd just stick with that.
IIF([IsTaxable],[ExtPrice]*(0,08),0)
Seems like a reasonable solution to me.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 8.