Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Microsoft Access IIF Function (IF/Then)

Loading...

Sign in or sign up now!
57,626
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 28, 2008

Learn how to use the IIF function in Access to perform IF/Then logic in your queries, forms, and reports. Go to www.599CD.com/Access/YouTube for more free tutorials.

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (599CD)

  • This is very useful to me, but how would I go about making a CASE function, as in VB.

    For instance.

    Select Case Number Case >100 Bla = "True"

  • @Hentanimanga You really can't create a SELECT CASE statement inside a query - which is where the IIF function is handy. You can NEST multiple IIF functions, though: IIF(X=Y,True,IIF(X=B,True,Fals­e))

  • Great video...Good pace and very clear.  How would you COUNT the number of records that were from NY?

  • @VBPE Use an Aggregate Query and set the field to COUNT. Look in my playlist for the "Microsoft Access Aggregate Query" lesson.

  • Also, how would I make this work?

    for instance, say I want a field to show up, only if another field is checked as yes?

    For instance

    Admin | Moderator | D.O.B

    If admin is ticked, moderator would show up, otherwise moderator is hidden. Is this possible at all?

  • You can't do this in a query, but you could do it in a form with a little programming. You would use an AfterUpdate event for a checkbox and say something like:

    If CheckBox1 then CheckBox2.visible = true

    else CheckBox2.visible = false

    end if

    Look for my other video tutorials on the AfterUpdate event for more help.

see all

All Comments (26)

Sign In or Sign Up now to post a comment!
  • COOOOOOOOOL Absolutely cool!!!! think I'm gonna die at my computer project but this vid is like a holy water for me hahaha

    thank you very much Mr.Richard :)

  • WOOOOOOOOOOOOOOOOOOOOW  i just did this thanks

  • If I type "True" in criteria, what will I get?

  • dear 599CD,

    could u help as i need to create iff function for SLA and priorties

    as i want to say: if the case is priorty 1 so the sla will be 4 hours and if it is p2 it will be 8 hrs and p3 is 24 hrs (this is the first field SLA ) and i need the results in date and time ,, so could u help me please,

    thanks in advance

  • This is very useful to me, but how would I go about making a CASE function, as in VB.

    For instance.

    Select Case Number Case >100  Bla = "True"

  • @599CD Sorry, could I please ask a question. Is there a formula/function I could use to add numbers in a field if the numbers in another parallel field where the same? E.g: Pupil ID | Points 1 2 1 3 2 3 Is there a formula I could use to that would make a query find the records with same 'Pupil ID', and then add the 'Points' they have together. E.g: Pupil ID | Points 1 2 1 3 It would then add 2+3 in a new column to make 5? Thx
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more