Results 1 to 4 of 4
  1. #1
    JQuinnC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    11

    Dates and queries

    I need to show a subform on my mainform that will list items that are late.



    I've made the query that correctly grabs the data I need, I just can't figure out how to make the criteria work the way I want. The relevant fields are:

    sblReservationDate
    sblNLPDocsReceived
    sblNLPDocsSent

    Basically, I want it to show me the DocsReceived query if we're more than 2 days past ReservationDate and DocsSent is null.

    I have the criteria of DocsReceived as "sblReservationDate>=Date() + 2 And IsNull(sblNLPDocsSent)" (without quotes).

    Am I doing this correctly?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Date math is done with DateAdd & DateDiff
    in your query,add a calculated field, DateDiff("d",[resDate],Date)
    then filter it's criteria >1

  3. #3
    Micron is online now Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    I'm thinking the problem is that you're using a function in your criteria: IsNull(sblNLPDocsSent)
    and that it should be sblNLPDocsSent= Null
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    JQuinnC is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2016
    Posts
    11
    Ok, I think I have this worked out.

    I set up two queries. One to determine when task is due and the other to determine if it's late.

    To set when a task is due is simple. All the fields are set as dates, so due date is Due: [field] + x (where x is the number of days out I want a task due, which for me is based on the completely date of the last task).

    To determine if a task is late, the code {<=Date()+2 And IsNull([sblTracking]![sblNLPDocsSent])=True} works.

    So, if the date is past the due date, and no date has been entered on the next phase of the task, the query shows. Having the =true part of the IsNull function seems to have fixed the problem.

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

Similar Threads

  1. Dates, Forms, and Queries
    By Ace2014 in forum Access
    Replies: 21
    Last Post: 06-18-2014, 06:01 AM
  2. Replies: 4
    Last Post: 03-15-2013, 04:00 AM
  3. Subtracting Dates in Queries
    By seanpbent in forum Access
    Replies: 1
    Last Post: 02-01-2013, 04:28 PM
  4. Dates and Queries (its hard to describe!)
    By Lauren1989 in forum Queries
    Replies: 6
    Last Post: 03-31-2011, 01:45 PM
  5. Handling dates in queries
    By mrk68 in forum Access
    Replies: 4
    Last Post: 03-23-2009, 06:35 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