Results 1 to 3 of 3
  1. #1
    TimC is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    34

    Query Sort Criteria

    I have a table that includes 5 years of data. I also have a number of queries that help sort the data to meet my needs. In the design view of one of the queries, I’ve indicated I only want data beginning January 1, 2017 through the current calendar year using the following: >#12/31/2016# And <#1/1/2018#. Unfortunately, I’m still getting incidents occurring on 12/31/2016. Can you help? Thanks.

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It sounds like the field that you are checking on has a time component piece to it.
    Note that when you leave it off, like 12/31/2016, it defaults to 12:00 AM.
    So, any entry that has a time component after midnight, like 12/31/2016 1:00 AM would be after 12/31/2016.

    If your dates may have time entries, I would recommend using this instead:
    Code:
    >=#1/1/2017# And <#1/1/2018#

  3. #3
    NTC is offline VIP
    Windows 10 Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    as Joe says, though even without a time element, incidents occurring on 12/31/2016 require the = symbol also

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

Similar Threads

  1. Replies: 1
    Last Post: 04-07-2014, 02:59 AM
  2. Need to add sort criteria to report
    By pellissier in forum Reports
    Replies: 13
    Last Post: 02-14-2013, 05:57 PM
  3. sort filter, doesn't sort everything
    By deso in forum Queries
    Replies: 4
    Last Post: 01-25-2013, 05:27 AM
  4. Replies: 3
    Last Post: 01-15-2013, 01:58 PM
  5. Sort Query
    By jice89 in forum Queries
    Replies: 3
    Last Post: 05-06-2011, 05:56 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