Results 1 to 3 of 3
  1. #1
    Sabosis is offline Novice
    Windows 10 Access 2016
    Join Date
    Dec 2017
    Posts
    1

    Return records if null


    I have a database to show employee attendance records. If an employee is on a corrective action, a query will show their corrective action date and any attendance occurences since that date. What it does not show is employees on a corrective action who have not had any occurrences since the corrective action took place.
    A criteria in the query is set to show occurences greater than the corrective date, this is why employees without occurences since the corrective date are left off of the query. Can i modify the criteria to have them included? Do i create a second query to show these employees, then join the 2 queries in a 3rd new query? Please advise, any help is appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Q1: qsCorrectives, shows all emps with a corrective date (tCorrectives table)...select empid, EventDate, Event (where [Event] ='corrective')

    Q2: qsOccurAfterCorrDate, join tCorrectives table to qsCorrectives on EMPID and set criteria:
    tCorrectives.Date > qsOccurAfterCorrDate.Date

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Welcome to the forum.......


    Realize that we know nothing about your dB. You ask "Can i modify the criteria to have them included?". It is possible. It depends on your dB design.
    Would you post the SQL of the query?


    How do you determine an employee has a "corrective action"? A Date field?
    How do you determine "attendance occurrences" A Date field?

    One option is to modify the existing query.
    Another is to create a new query that finds employees that have a "corrective action" but no "attendance occurrences" from a specified date, then join the two queries in a union query.

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

Similar Threads

  1. Replies: 2
    Last Post: 10-01-2015, 10:10 AM
  2. Replies: 9
    Last Post: 08-19-2014, 12:41 PM
  3. Replies: 2
    Last Post: 06-03-2013, 11:02 AM
  4. Return Null as Zero
    By bbshriver in forum Reports
    Replies: 12
    Last Post: 10-19-2010, 01:49 PM
  5. Return 0 instead of null
    By salisbut in forum Queries
    Replies: 1
    Last Post: 08-07-2010, 12:01 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