Results 1 to 3 of 3
  1. #1
    charlesk is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    2

    Query to return before a date or if the date field is null

    Greetings,

    I am trying to create a query that will return records that are before a date (input by user) or if the date field is empty. This is what I have tried and it works great except that it doesn't return the empty date records.

    (<=[Enter End Date:]) Or (IsNull(""))

    Any assistance is greatly appreciated.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Shot in the dark, but try

    <=[Enter End Date:] Or Is Null
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    humanexhaust is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Sep 2014
    Posts
    6
    Im assuming you are trying to use the Query Design View. Try passing the variable through the IsNull function like below.


    Your example should look like: (<=[Enter End Date:]) Or (IsNull([Enter End Date:]))

    Or..

    Use the criteria as suggested below.

    Click image for larger version. 

Name:	Help.png 
Views:	9 
Size:	2.7 KB 
ID:	18182

    Im not going off of much description here but I hope this helps. I could also give you the VBA If statement if you require that route.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-22-2014, 10:54 AM
  2. Replies: 7
    Last Post: 07-17-2014, 12:42 PM
  3. date field in subform not becoming null
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 04-03-2014, 07:26 PM
  4. Replies: 3
    Last Post: 04-01-2012, 01:40 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