Thread: [SOLVED] Error on IIF
View Single Post
Old 08-12-2019, 06:31 AM   #19
Longboard on the internet
Join Date: Sep 2017
Location: Not the middle of no where, but I can see the road to it from my house.
Posts: 2,112
Thanks: 20
Thanked 405 Times in 396 Posts
Mark_ will become famous soon enough Mark_ will become famous soon enough
Re: Error on IIF

@ OP,

So you can better understand what CJ_London was posting about,
ANY time you pass a value inside quotes or any time you tell something to be returned in quotes, ACCESS treats it as a text value, not numeric.

As such, when you have
Yes: IIf([Successful]="Yes","1","0")
ACCESS us looking for the literal text "Yes" inside your [Successful] field and returning either the character "1" or the Character "0". To get ACCESS to check the field [Successful] for the value of Yes (value -1) and return a number you would need to change it to be
Yes: IIF([Successful] = True, 1, 0)
This is one piece that I think was giving you some issues.
Mark_ is offline   Reply With Quote
The Following User Says Thank You to Mark_ For This Useful Post:
Adamfm (08-12-2019)