Solved

IFF expression

Posted on 2012-03-19
6
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 500 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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

Author Closing Comment

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

Expert Comment

by:Dale Fye (Access MVP)
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

691 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