Results 1 to 3 of 3
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Searching for a null


    I'm building a database for work that keeps tabs on checks employees are doing. I can build a query showing the activity of each employee. However, when I'm doing a search of dates (I use the BETWEEN command), It will find everyone that has activity. If there is no activity, there is nothing to search for if there is no activity. I need all employees listed with the number of checks done. If someone has no activity, I need it to show "0." I'm having a hard time figuring this out.

  2. #2
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Without more information like what tables are involved or seeing the sql it's a guess as to the best solution. You could wrap the number field in the NZ function to return 0:
    Nz(somefield, somefield,0).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,933
    If someone has no activity, I need it to show "0."
    As Micron says, need more information.

    A possible solution is to left join the employees table to your query on employeeID. This will return null values instead of 0 for those employees without a count, but you can subsequently display 0 instead of null in your form or report using the format property

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

Similar Threads

  1. Replies: 4
    Last Post: 03-11-2017, 09:48 PM
  2. Replies: 7
    Last Post: 11-07-2016, 09:24 AM
  3. Searching and replacing "null" values
    By biederboat in forum Access
    Replies: 20
    Last Post: 07-19-2016, 12:49 PM
  4. Problems with searching with null values
    By offie in forum Queries
    Replies: 5
    Last Post: 07-15-2013, 11:38 AM
  5. Replies: 1
    Last Post: 02-23-2012, 02:27 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