M
Matt
Hi there,
I'm trying to document a database that someone else has created. I'm going
through each query step-by-step to identify how each part works. I've come
to a stumbling block with the following statement:
Pen_%: IIf([Disc_%]*[Disc_Factor]>1,1,[Disc_%]*[Disc_Factor])
MSDN for IIf says iif(evaluation, truepart, falsepart)
OK, so given a disc_% of 9.02% and a Disc_Factor of 2.85 I'm checking if
9.02% x 2.85 is greater than 1. If it is, return 1 otherwise return the
result.
I think it's not working correctly as access is giving Pen_% as 25.71% which
is greater than 1 so 1 should be returned right? I've tried forcing the
evaluation order with parenthesis.
It could be that I don't quite understand how the percentage data type is
handled.
Many thanks for your time.
I'm trying to document a database that someone else has created. I'm going
through each query step-by-step to identify how each part works. I've come
to a stumbling block with the following statement:
Pen_%: IIf([Disc_%]*[Disc_Factor]>1,1,[Disc_%]*[Disc_Factor])
MSDN for IIf says iif(evaluation, truepart, falsepart)
OK, so given a disc_% of 9.02% and a Disc_Factor of 2.85 I'm checking if
9.02% x 2.85 is greater than 1. If it is, return 1 otherwise return the
result.
I think it's not working correctly as access is giving Pen_% as 25.71% which
is greater than 1 so 1 should be returned right? I've tried forcing the
evaluation order with parenthesis.
It could be that I don't quite understand how the percentage data type is
handled.
Many thanks for your time.