Results 1 to 2 of 2
  1. #1
    tylerg11 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Sep 2011
    Posts
    200

    Query for current month and year onward

    Hi,



    I'd like to add criteria to my query to only show records that have a date in the current month and the future. The records are only excluded from the query when the month they are in has passed. Here is what I'm trying to do.

    Show all records from our current month (which is currently December 2013) and onward. The moment we flip the calendar to January 2014, the December 2013 records no longer show. So all records show unless the month/year occurs in the past.

  2. #2
    lfpm062010 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Location
    US
    Posts
    415
    Based on what you said.

    You can use the Date() or Now() to get today's date and use your date field to compare against.
    Something like.

    SELECT TABLENAME.SOMETHING
    FROM TABLEANME
    WHERE TABLENAME.YOURDATEFIELD >= Now();

    Note: If you "YOURDATEFIELD" is not DATE/TIME type, you can use function "CDATE" to convert the textstring to an actual date.

    SELECT TABLENAME.SOMETHING
    FROM TABLEANME
    WHERE CDATE(TABLENAME.YOURDATEFIELD) >= Now();

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

Similar Threads

  1. Current Month/Year Query
    By Roadbeer in forum Queries
    Replies: 3
    Last Post: 06-17-2013, 01:20 PM
  2. Replies: 4
    Last Post: 05-26-2013, 03:28 PM
  3. Month and Day only not Year to create query
    By ssalem in forum Queries
    Replies: 3
    Last Post: 02-28-2013, 02:37 PM
  4. Query / report per month and year
    By ripper in forum Queries
    Replies: 2
    Last Post: 10-24-2011, 07:51 AM
  5. Current Month and Year-To-Date
    By DSnipeFunk in forum Access
    Replies: 4
    Last Post: 05-31-2011, 11:38 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