Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2012
    Posts
    23

    Problem with query statement

    Guys,

    I have the following situation. I've created a database for different tests within my company. If you want to receive a degree you have to do two thing:

    - pass exam with > 5,5
    - pass assignment with a grade which is dependent on your workfield (operations dpt requires a 6, sales a 5)

    I managed to get this working by adding the following text in the expression builder of a query:

    ASSIGNMENT PASSED: IIf([ASSIGNMENTMENT_PASSED]>=[ASSIGNMENTMENT_PASSED_REQUIRED];"PASSED";"NOTPASSED")

    And then I build another query based on this query which filters records which have a grade >5,5 and an ASSIGNMENT PASSED value of "PASSED"

    So far so good. Only now they are going to change the assignment values required. So I'm facing a situation where:

    - people of particular workfield who took the test > 01-01-14 have a particular threshold value
    - people of that same workfield who took the test < 01-01-14 have a particular threshold value



    So I have to include the date of my table into the query which determines whether or not people passed. Only cant find an efficient way to do this. Anybody suggestions?

    Thanks in adance.

    Dear regards,

    Marc

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,624
    ASSIGNMENT_PASSED and ASSIGNMENT_PASSED_REQUIRED are the test scores? So 5.5 is not good enough for operations but too good for sales?

    "If testdate>=1/1/14 then meet this criteria else this"

    IIf(testdate >= #1/1/2014#, this expression, this expression)

    Depending on how many different conditions, could need a custom function.
    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
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    if there were lots of values involved - rather than one date, one test and one grade value - - probably the only sane way to approach it would be to make a 'passing grade' table ....and then you would query that table using the criteria of the record (i.e. date, test,) and then do a compare.... possibly a DLookUp rather than a query. But what I guess I'm saying is that as posted you kind of are in an inbetween situation where taking a table approach as I suggest is probably more work than shoe horning in more IIF code......

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

Similar Threads

  1. SQL Query Statement - ORDER BY problem
    By hinsdale1 in forum Forms
    Replies: 5
    Last Post: 04-24-2013, 08:40 AM
  2. HELP: Query Problem using IF statement
    By lalaland in forum Queries
    Replies: 13
    Last Post: 03-21-2013, 03:15 PM
  3. problem with IF THEN statement in access 2003 query
    By sfgiantsdude in forum Access
    Replies: 4
    Last Post: 01-05-2012, 04:23 PM
  4. Problem with a IIF statement
    By Genzo in forum Access
    Replies: 10
    Last Post: 08-31-2011, 10:46 AM
  5. Problem With IF Statement
    By MuskokaMad in forum Programming
    Replies: 0
    Last Post: 03-14-2010, 05:26 PM

Tags for this Thread

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