Results 1 to 3 of 3
  1. #1
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31

    Query that shows dates near today

    Hello All,

    I am trying to (and failing) build a query that shows me result that are within a month in the past to today. (confusing I know, ill explain)

    Simple example: I have a table with a bunch of records on a contract, it basically shows contract start date and contract end date, What I would like to do is build a query that will show me all of the contracts that are within a month of running out.

    For instance:
    Id Contract Name Start date end date
    1 Dan C. Bell Pay as you go 05/09/2012 04/09/2013
    2 Luke J. Fox Pay as you go 30/09/2012 29/09/2013
    3 Leila P.M. Cortez Pay as you go 11/10/2012 10/10/2013
    4 Dean O. Fisher Unlimited Contract 02/09/2012 01/09/2013
    5 Pete D. Wizlan 2GB Contract 31/10/2012 30/10/2013
    6 Mary I. Jane Unlimited Contract 18/09/2012 17/09/2013
    7 Kathy L. Saunders Unlimited Contract 10/09/2012 09/09/2013
    8 John M. Barrymore Unlimited Contract 26/11/2012 25/11/2013
    9 Liza M. Nelly Pay as you go 22/12/2012 21/12/2013
    Now the query should only show dates running out within a month of today (today being 03/09/2013), which would mean it should show records 1, 2, 6 and 7 as they are just about to run out.

    Any one help me please!!!



    Thanks in advance

    Kind regards
    Luke

  2. #2
    amrut is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Location
    India
    Posts
    616
    Use criteria for the End Date field in query
    Code:
    Between Date() and DateAdd ("m", 1, Date())
    See http://www.techonthenet.com/access/f...te/dateadd.php for use of dateadd function.

  3. #3
    LukeJ Innov is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    31
    Thankyou, great help, just what I needed.
    Will add to rep.

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

Similar Threads

  1. Date field that shows only related dates
    By kelkan in forum Access
    Replies: 1
    Last Post: 01-27-2013, 04:00 PM
  2. Replies: 5
    Last Post: 10-12-2012, 11:00 AM
  3. Query criterion for today and the future
    By scoughlan in forum Queries
    Replies: 3
    Last Post: 01-16-2012, 07:28 PM
  4. Query to display ONLY entries from today
    By Juan4412 in forum Queries
    Replies: 9
    Last Post: 01-15-2011, 05:34 PM
  5. query date that is five years older than today
    By cpsummer in forum Queries
    Replies: 2
    Last Post: 09-26-2007, 02:31 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