Using IIF Function in MS Access..

hardikdani15

New member
Local time
Today, 13:00
Joined
Sep 25, 2006
Messages
1
Hey.

I really could need help with the using of the IIf function in the queries of MS access. I really need to know how to use them.. So please help me out as fast as possible...


please..

Hardik
 
You might do a search on this forum on IIF or search in Access help.

What will be your purpose to the use the IIF function ?
 
It's very much like the "if" statements in excel if that is what you're used to...

...iif not... well.

iif([condition is met], [then do this], [otherwise do this])

Example:

You have a field called "Color" and you want it to display "Yes" in another field called "IsRed" if the color is red.

iif([color]="Red", "Yes", "No")

End result
Code:
Color         IsRed
Red           Yes
Blue           No
Green         No

Now, you can use all kinds of variations on that, especially when working with numbers. You can use ">" or "<" or "<>" (not equal to) or ">="... whatever you desire. The best thing to do is experiment a little. A lot of the time, it'll tell you what you're missing!
 

Users who are viewing this thread

Back
Top Bottom