Results 1 to 3 of 3
  1. #1
    JTKrol is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    21

    Unhappy Return records with several null date fields in one record, in one table.

    Hey,
    I was not at all clear in what I am trying to do when I posted this hope this edit helps...

    I have three date fields that that are associated with all people in the db I want to query. I only want records that have a null in any of the three fields to be returned, and if 1 or 2 of the other fields have dates in them those dates should show as well (see below).

    Problem is one person can have a null field in one, two or all three records. I tried using the Is Null but when I line them up my query only returns records that have all three dates null...

    I've tried Ruegen's solution but that does not return what I need either...



    With that give me a result similar to this? John Smith has the FP and PDCA in but is missing the StPDChk, Jane smith has the FP and StPDChk but is missing the PDCA and Mike Smith has nothing turned in.

    Last Name First name DOB Supervisor FPMissing StPDChkMissing PDCAMissing
    Smith John 01/01/1980 Mike Jones 12/10/2015 11/09/2015
    Smith Jane 11/01/1992 Sue Mi 12/10/2015 11/09/2015
    Smith Mike 02/01/1995 Sue Mi

    ARG>>>>>
    Last edited by JTKrol; 10-01-2015 at 05:36 AM. Reason: Did not explain properly

  2. #2
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Few ways to do this one is to make a custom query field in your query
    Code:
    NewField: iif(isnull([Field]),0,[Field])
    - this will turn any null field into 0 or if it is a string field "nothing" and thus show as it won't be null

    If you search this forum you should find some other solutions (even I have posts where I wasn't able to see null rows)

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    You are not going to be able to assign 0 to a date field. Have you tried using the criteria option while in design view of a query object? If you add criteria Is Null in the grid at the bottom of the Designer Window, it will only retrieve the records that are Null for that Column. You can include additional columns in your criteria by adding Is Null to the respective column(s).

    Here is the caveat. Adding criteria to multiple columns can employ the OR operator as well as the AND operator. When adding criteria to the grid, adding to the same row will employ the AND operator. You can employ the OR operator by dropping down one row from the previous. It sounds like you want to use different rows when adding your criteria to the grid.

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

Similar Threads

  1. Replies: 2
    Last Post: 09-23-2014, 11:32 AM
  2. Replies: 9
    Last Post: 08-19-2014, 12:41 PM
  3. Replies: 1
    Last Post: 06-27-2013, 09:33 AM
  4. Replies: 1
    Last Post: 10-26-2011, 05:13 AM
  5. Replies: 0
    Last Post: 03-06-2011, 04:10 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