Help with IIF Statement in a Query

Woelfe

New Member
Joined
Sep 17, 2002
Messages
35
Hello! I am hoping to get some help with an expression I am trying to write in an Access query. I have managed to create an expression called Cumulative that adds two other fields together. The new expression I am having trouble writing is to evaluate the amount in Cumulative and return either a True or False answer based on the IIF function.

What I have written is:

IIf ([Cumulative] > «Expr» = «Expr» "3772", [Cumulative] * «Expr» "0.0106065", "40")

Basically, if Cumulative is greater than or equal to 3772 I want it to take Cumulative and multiply it by by 0.010605, otherwise just show 40.

I built this using the Expression Builder, but when I try to run the query I get an error: The expression you entered contains invalid syntax - you may have entered an operand without an operator.

I am very new to building expressions so any suggestions are greatly appreciated.

Thank you in advance...
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,280
Office Version
  1. 365
Platform
  1. Windows
Remove each instance of this from the expression.
Code:
<<Expr>>

I would also suggest you remove the quotes from the numbers.
 

Woelfe

New Member
Joined
Sep 17, 2002
Messages
35
Remove each instance of this from the expression.

I would also suggest you remove the quotes from the numbers.

Norie, thank you so much! The <<Expr>> was dropped in while using the builder automatically. Originally I didn't have the quotes on the numbers, but then thought maybe I should. It worked perfectly now.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,280
Office Version
  1. 365
Platform
  1. Windows
Woelfe

No problem.

It's sometimes useful for the builder to include that - it can help remind you what arguments are needed.

But it can be annoying sometimes.:)
 

Watch MrExcel Video

Forum statistics

Threads
1,129,553
Messages
5,636,983
Members
416,953
Latest member
broexc

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top