[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

IFF expression

Posted on 2012-03-19
6
Medium Priority
?
397 Views
Last Modified: 2012-06-27
Why is only the first part working on this?  This only subtracts 5% from all prices.

Iff([DatePosted]>3/4/2012,[Price]-.05*[Price],[Price]-.03*[Price])

I appreciate your help.
0
Comment
Question by:ocdc
  • 3
  • 2
6 Comments
 
LVL 75
ID: 37740764
Try this ... with #'s wrapping the date:

Iff([DatePosted] > #3/4 /2012#, [Price] - 0.05 * [Price], [Price] - 0.03 * [Price])

mx
0
 

Author Comment

by:ocdc
ID: 37740790
the #'s prompt me for a date.  [DatePosted] is the date, so I should not be getting a prompt.
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 37740793
I had one extra space in the date literal ... try this:

Iff([DatePosted] > #3/4/2012#, [Price] - 0.05 * [Price], [Price] - 0.03 * [Price])

or

Iff([DatePosted] > CDate("3/4/2012"), [Price] - 0.05 * [Price], [Price] - 0.03 * [Price])

Are you using this in a query?

mx
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Closing Comment

by:ocdc
ID: 37740798
It worked great.  Thanks.
0
 
LVL 75
ID: 37740803
which one ?
0
 
LVL 49

Expert Comment

by:Dale Fye
ID: 37741708
I'm assuming you guys meant  IIF( )   not    IFF( )

;-)

You could also have used:

[Price] * (1-iif([DatePosted] > #3/4/2012#, .05, .03))
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question