Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    xps35's Avatar
    xps35 is online now Competent Performer
    Windows 10 Office 365
    Join Date
    Jun 2022
    Location
    Schiedam, NL
    Posts
    229

    Quote Originally Posted by templeowls View Post
    I need a query to show complaints only up to today (July 11). I.e. it'd only show entries from 1.1.2011 to 7.11.2011 and 1.1.2012 to 7.11.2012 and 1.1.2013 to 7.13.2013 and so on......
    In my humble opinion, that's exactly what my last suggested query does (see post #10). If not, I'd love to hear what the difference is.

  2. #17
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Is this the logic you are trying to use??

    For years between CurrentYear and CurrentYear-10 {Note: between includes endpoints}
    get data for Month =1 to CurrentMonth and Day = 1 to CurrentDay

    I'm just trying to understand what isn't working and hopefully get a sample of what the desired output would be.

    Based on your example database, try this query:


    Code:
    SELECT tblComplaints.ID
    , tblComplaints.ComplaintNumber
    , tblComplaints.ComplaintDate
    FROM tblComplaints
    WHERE
     (((Month([tblComplaints]![ComplaintDate]))<=Month(Date())) AND
     ((Day([tblComplaints]![ComplaintDate]))<=Day(Date())) AND
    (Year([tblComplaints]![ComplaintDate])>=Year(Date())-10));

  3. #18
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    305
    Quote Originally Posted by xps35 View Post
    In my humble opinion, that's exactly what my last suggested query does (see post #10). If not, I'd love to hear what the difference is.
    You're right!! This worked! Sorry I missed this one.

    Thanks for everyone's help!!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Using Queries to create entries
    By JuanL in forum Queries
    Replies: 5
    Last Post: 04-05-2022, 09:17 AM
  2. Replies: 2
    Last Post: 05-01-2017, 12:37 PM
  3. Queries for forms - identify duplicates
    By BSJoJaMAx4 in forum Forms
    Replies: 10
    Last Post: 08-11-2015, 09:46 PM
  4. Replies: 4
    Last Post: 02-11-2014, 05:37 PM
  5. Queries, using record entries only once?
    By no1beyondfan in forum Queries
    Replies: 11
    Last Post: 04-20-2011, 08:57 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