Avatar of ocdc
ocdc
Flag for United States of America asked on

IFF expression

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.
Microsoft Access

Avatar of undefined
Last Comment
Dale Fye

8/22/2022 - Mon
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

Try this ... with #'s wrapping the date:

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

mx
ocdc

ASKER
the #'s prompt me for a date.  [DatePosted] is the date, so I should not be getting a prompt.
ASKER CERTIFIED SOLUTION
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ocdc

ASKER
It worked great.  Thanks.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)

which one ?
Dale Fye

I'm assuming you guys meant  IIF( )   not    IFF( )

;-)

You could also have used:

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