Results 1 to 2 of 2
  1. #1
    tkbuc is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2017
    Posts
    1

    Adding in Date Range selector to query

    Hi everyone,



    I have the query below and I am trying to add in the date field from my table which is called "Created". I want the query to run exactly as below, I just want to only have it pull records within a certain date range.

    I am dragging the field into the query and using the BETWEEN [Start Date] and [End Date] criteria for the field. In the total field, it's set as "Group By". I don't want the dates to show in the query, so I unchecked "Show" box. When I go to run the query, it expands the "Request Type" field instead of having each request type grouped. What am I doing wrong? Any help would be greatly appreciated!


    SELECT [Reporting and Metrics Tracker].[Request Type], Count([Reporting and Metrics Tracker].ID) AS [Total Requests], [Snapshot Complete].CountOfStatus AS [Total Completed], Sum([Reporting and Metrics Tracker].[Effort per occurence]) AS [Time (hrs)]
    FROM [Reporting and Metrics Tracker] LEFT JOIN [Snapshot Complete] ON [Reporting and Metrics Tracker].[Request Type] = [Snapshot Complete].[Request Type]
    GROUP BY [Reporting and Metrics Tracker].[Request Type], [Snapshot Complete].CountOfStatus;

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Something like:
    Code:
    SELECT [Reporting and Metrics Tracker].[Request Type], Count([Reporting and Metrics Tracker].ID) AS [Total Requests], [Snapshot Complete].CountOfStatus AS [Total Completed], Sum([Reporting and Metrics Tracker].[Effort per occurence]) AS [Time (hrs)]
    FROM [Reporting and Metrics Tracker] LEFT JOIN [Snapshot Complete] ON [Reporting and Metrics Tracker].[Request Type] = [Snapshot Complete].[Request Type]
    WHERE [Table Reference].[Created] Between [Start Date] and [End Date]
    GROUP BY [Reporting and Metrics Tracker].[Request Type], [Snapshot Complete].CountOfStatus;
    (obviously replacing "Table Reference" with the name of the table that the Created field resides in)

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

Similar Threads

  1. Replies: 3
    Last Post: 01-26-2016, 01:56 PM
  2. Query selector
    By Homegrownandy in forum Access
    Replies: 1
    Last Post: 10-15-2015, 05:59 AM
  3. Date Range selector
    By Newbie11 in forum Reports
    Replies: 8
    Last Post: 05-11-2012, 12:46 PM
  4. Date Range Query
    By need_help12 in forum Queries
    Replies: 7
    Last Post: 04-25-2012, 01:38 PM
  5. Run query by date range
    By ARickert in forum Access
    Replies: 2
    Last Post: 06-23-2011, 10:54 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