Results 1 to 3 of 3
  1. #1
    nomi123 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2013
    Posts
    1

    If and then multiple statements - how do I do it?

    In a report I am accessing two tables - one contains company criteria and one contains student information. I need an iif statment that will tell me which students meet the company's criteria. For example: I want to match all students whose gpa, major and citizenship match the company criteria. i.e. iif the students major is CS and their minimum gpa is >2.5 and their citizenship is citizen or PR then they quality for this company.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Do you have a query that joins the two tables on the 3 criteria fields?

    Then create field in query with expression:

    IsMatch: IIf(Student.Major=Company.Major AND Student.GPA=Company.GPA AND Student.Citizenship=Company.Citizenship, True, False)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    In a query, use the student table as your recordset. Set the criteria for each field in the grid. Run the query. The end result will be filtered on your established criteria.

    http://office.microsoft.com/en-us/tr...aspx?section=2

    http://www.baycongroup.com/access2007/05_access.html

    http://www.youtube.com/watch?v=nxBUQ_ZuGtI

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Multiple IIF statements returning -1 instead of 1
    By BoesFarmers in forum Programming
    Replies: 3
    Last Post: 05-20-2013, 08:38 AM
  2. How to use multiple IIf statements in a query
    By jabadoojr in forum Queries
    Replies: 4
    Last Post: 12-17-2012, 11:05 AM
  3. Multiple iif statements
    By rlsublime in forum Queries
    Replies: 3
    Last Post: 04-25-2012, 10:33 AM
  4. Multiple SQL Statements
    By springboardjg in forum Queries
    Replies: 1
    Last Post: 04-18-2011, 10:32 AM
  5. Multiple IIF statements
    By KevinMCB in forum Queries
    Replies: 4
    Last Post: 12-03-2010, 01:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums