Results 1 to 3 of 3
  1. #1
    younggunnaz69 is offline Novice
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    7

    Query-Display next time an event occurs

    I am a novice at access and would like help creating a query. Any help is appreciated. Thanks!!



    I have a table called Audits where every audit that occurs is logged. Below is a query that will show me every audit that has scored a rating of Needs Improvement or Fail. In this query I would like to make an additional column that will display the very next date this location is scheduled to be audited based on the field AuditDate (fyi-every location has a unique Number assigned called LocNum) There is a chance that a location that receives one of these ratings may not have a future date scheduled

    Then I would like a column that calculates the number of days between the 2 dates.

    SELECT Audits.AuditDate, Audits.Location, Audits.LocNum, Audits.Rating
    FROM Audits
    WHERE (((Audits.Rating)="Needs Improvement" Or (Audits.Rating)="Fail"));

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    In a new column in your query, create an expression using a combination of the IIF function and the DateAdd Function. Both of these functions can be explained at this site.

    www.techonthenet.com

    Alan

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    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. Replies: 3
    Last Post: 09-02-2011, 01:12 PM
  2. Time Schedule display in access
    By snoopy2003 in forum Database Design
    Replies: 3
    Last Post: 03-23-2011, 04:41 PM
  3. access time display issue at liknked table
    By newaccess in forum Access
    Replies: 0
    Last Post: 05-14-2010, 09:24 AM
  4. Display a message for some time
    By wasim_sono in forum Programming
    Replies: 2
    Last Post: 03-05-2010, 11:11 AM
  5. Calculate Time and Display Records
    By w2vijay in forum Reports
    Replies: 1
    Last Post: 02-12-2010, 01:58 AM

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