Results 1 to 4 of 4
  1. #1
    Badvgood is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Dec 2011
    Posts
    4

    Criteria to find when cells are blank

    Hi, I am trying very hard to get the hand of access but keep hitting walls, so any that assist it is greatly appreciated but keep it simple for me please!!!



    Please see the attachment, I need to put a criteria in the cell where the cursor is that says;

    Where the next service date in the Kerridge database is blank, empty or --/--/-- then return this.

    Currently when I run this query I only get results returned where we know the MOT date and the service date has an entry in it.

    But I know there are some entries on the database where the MOT date fits the query criteria but they are not being returned because there is no data in the service date cell.

    Thanks in advance.

  2. #2
    hertfordkc is offline 18 year novice
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    481

    There are subtlilties in Access that catch nearly everyone and you just

    got caught. A null entry is not the same as an empty entry. One way around the problem is to use the NZ function in a calculated field to replace the null with an empty, "", 0, or " " value. For a date value, I'm not sure which you need.
    Google "Access null values".

  3. #3
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by hertfordkc View Post
    One way around the problem is to use the NZ function in a calculated field to replace the null with an empty, "", 0, or " " value.
    I'm gonna doubt this, although I haven't tested. No reason at all to believe Access's nz() function would work properly, given the bug involved in this. see #1 here, if you haven't already:

    https://www.accessforums.net/tutoria...ess-19282.html

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,743
    badvgood,

    If the next service date is a Date\Time datatype, you can use the IsDate() built in function to test that it contains a valid Date.

    If you are really testing for empty/blank,you can use
    Len(Trim(ServiceDateField) & "") which will be 0 is the field is blank/empty

    Another alternative would be to use a default Date such as 1/1/1900 or something to signify that a valid date in terms of your application has not been set. You could test the ServiceDateField <> default value

    Perhaps you could describe why you are checking that field for blank/empty.

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

Similar Threads

  1. Select Query on Criteria or Blank?
    By batowl in forum Queries
    Replies: 4
    Last Post: 08-17-2011, 02:34 PM
  2. Replies: 1
    Last Post: 07-25-2011, 09:57 AM
  3. Replies: 1
    Last Post: 07-13-2011, 11:00 AM
  4. Using if to find blank fields?
    By newtoAccess in forum Queries
    Replies: 4
    Last Post: 03-20-2011, 10:48 AM
  5. Find existing record with multiple criteria
    By TheWedgie in forum Forms
    Replies: 1
    Last Post: 03-25-2009, 10:24 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