Results 1 to 9 of 9
  1. #1
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7

    Query Question - Help Please

    Hi guys,

    So I need to create a query that does the following:

    Click image for larger version. 

Name:	database.jpg 
Views:	7 
Size:	67.0 KB 
ID:	21779
    I was told to use the Switch function, but that didn't quite work out...Before that I was trying the IIF AND statements, but couldn't get it right...(I was only able to input "Call Missed" but not the others.) Any help on how to do this would be appreciated...

  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,771
    Post your attempted query SQL statement.

    Maybe

    Status: IIf([EndDate]<Now(), IIf([CompletedCallDate] Is Null, "Call Missed/Check if Call Made", "Completed"), "To Be Completed")
    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
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7
    A1CT3Message: IIf([DateA1CT3TO]<Date() And IsNull([CompletedDateA1CT3]),"Missed Data Point", IIf([DateA1CT3TO]>Date() AND Not IsNull([CompletedDateA1CT3], “Complete”, “To be Completed”))

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    That expression does not fit the flow diagram you posted. Did you try my suggestion?
    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.

  5. #5
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7
    Wow, yes it did! Thanks very much

  6. #6
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7
    ohh oops, the only other thing is that, if the EndDate > Now, but there is a completed call date, it should say complete. I think I messed that up in the diagram

  7. #7
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7
    Click image for larger version. 

Name:	database.jpg 
Views:	5 
Size:	53.3 KB 
ID:	21782
    redid the diagram.

  8. #8
    totslnewbie is offline Novice
    Windows 7 32bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    7
    ok i was able to redo the code you provided based on the above diagram. works now, thank you very much.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Okay then I see why you tried that.

    Will EndDate ever be Null?

    Maybe:

    IIf([EndDate]<Now(), IIf([CompletedCallDate] Is Null, "Call Missed/Check if Call Made", IIf([CompletedCallDate]>Now, "Completed", "To Be Completed"), "Completed")

    or

    IIf([EndDate]>Now() Or [CompletedCallDate]>Now, "Completed", IIf([CompletedCallDate] Is Null, "Call Missed/Check if Call Made", "To Be Completed"))
    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.

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

Similar Threads

  1. Query question/help
    By 9944pdx in forum Queries
    Replies: 4
    Last Post: 12-12-2017, 08:13 PM
  2. Query question
    By jscriptor09 in forum Queries
    Replies: 1
    Last Post: 03-28-2014, 06:47 PM
  3. Query Question
    By sdy007 in forum Queries
    Replies: 1
    Last Post: 08-21-2013, 03:44 PM
  4. Query Question
    By starhannes in forum Queries
    Replies: 13
    Last Post: 05-06-2010, 04:05 PM
  5. Query Question
    By Guiseppe in forum Queries
    Replies: 5
    Last Post: 03-23-2010, 04:32 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