Results 1 to 2 of 2
  1. #1
    riverist is offline Novice
    Windows 8 Access 2013
    Join Date
    Feb 2015
    Posts
    3

    How do I Use Relative Dates as Query Criteria

    It seems (and probably is) simple, but I can't find a statement that works.

    I want to find all records where the field IssueDate is after June of the current year and before July of the next year.

    I can hard code it for 2016 by putting >#6/30/2016# And <#7/1/2017# in the criteria, but I'd like to do it so it works any current year.

    Everything I try produces an error.



    Thanks!

  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,652
    See if this gives you some ideas:

    ?DateSerial(IIf(Month(Date()) < 7, Year(Date()) - 1, Year(Date())), 7, 1)
    7/1/2015
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query with many criteria (Dates, Condition, etc)
    By soldat452002 in forum Queries
    Replies: 5
    Last Post: 06-25-2014, 05:01 PM
  2. Using Dates in Query Criteria
    By brett621 in forum Queries
    Replies: 12
    Last Post: 07-02-2013, 11:27 AM
  3. Query Criteria with Multiple Dates
    By Jojojo in forum Queries
    Replies: 3
    Last Post: 10-08-2011, 05:07 PM
  4. Dates in query criteria
    By thart21 in forum Queries
    Replies: 7
    Last Post: 01-24-2011, 11:56 AM
  5. Dates: query and criteria
    By isnpms in forum Queries
    Replies: 5
    Last Post: 08-22-2010, 08:01 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