leishtheman15
New Member
- Joined
- Jan 17, 2013
- Messages
- 22
Hello
I'd like some advice as I'm not sure if I'm going mad or not.
I've wasted around 3 frustrating hours today on what should have been a simple query expression which refused to generate the correct answer. I was using the below, with val used to convert the two currency fields [ExtendedPrice] and [UnitPrice] to a number to match [Qty]:
flag: IIf(Val([Test2]![ExtendedPrice])/Val([Test2]![UnitPrice])<>[Test2]![Qty],1,0)
This refused to work. I eventually found a solution by combining the result of ([Test2]![ExtendedPrice])/([Test2]![UnitPrice] within a single Val statement:
flag: IIf(Val([Test2]![ExtendedPrice]/[Test2]![UnitPrice])<>[Test2]![Qty],1,0)
I have absolutely no idea why the top statement refused to work when the bottom one did work?
Can anybody explain???
Many thanks,
Andy
I'd like some advice as I'm not sure if I'm going mad or not.
I've wasted around 3 frustrating hours today on what should have been a simple query expression which refused to generate the correct answer. I was using the below, with val used to convert the two currency fields [ExtendedPrice] and [UnitPrice] to a number to match [Qty]:
flag: IIf(Val([Test2]![ExtendedPrice])/Val([Test2]![UnitPrice])<>[Test2]![Qty],1,0)
This refused to work. I eventually found a solution by combining the result of ([Test2]![ExtendedPrice])/([Test2]![UnitPrice] within a single Val statement:
flag: IIf(Val([Test2]![ExtendedPrice]/[Test2]![UnitPrice])<>[Test2]![Qty],1,0)
I have absolutely no idea why the top statement refused to work when the bottom one did work?
Can anybody explain???
Many thanks,
Andy