Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6254969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T14:16:41+00:00 2026-05-24T14:16:41+00:00

I am having the toughest time getting a query created for this scenario: I

  • 0

I am having the toughest time getting a query created for this scenario:

I need to list all parts that were late and sum them by quarter.

Here is the query that I have so far:

SELECT DISTINCTROW 
    Format$([InvoiceSub].[Date_Shipped],'\Qq yyyy') AS [Date_Shipped By Quarter]
,   Sum(InvoiceSub.Quantity) AS [Sum Of Quantity]
FROM 
    InvoiceSub 
    INNER JOIN 
        Job_Book_Sub 
        ON (InvoiceSub.[Job #] = Job_Book_Sub.[Job #]) 
        AND (InvoiceSub.[LineItem#] = Job_Book_Sub.[LineItem#])
GROUP BY 
    Format$([InvoiceSub].[Date_Shipped],'\Qq yyyy')
,   Year([InvoiceSub].[Date_Shipped]) * 4 + DatePart('q', [InvoiceSub].[Date_Shipped]) -1;

This query works fine to display all parts that were shipped by quarter. However, I want to see all parts that were shipped LATE by quarter.

I have a field in a table named: Job_Book_Sub, and that field is [LineItem_DueDate]. I want to use that in the query so that it will display all parts that were late ([date_shipped] > [lineitem_duedate]). The [date_shipped] is the actual date the parts were shipped, [lineitem_duedate] is the date the parts were due. I know that I need to incorporate these two fields into the query, I just don’t know how.

Can someone please show me how to do this? If I add the [LineItem_DueDate] to the query, then it no longer sums the dates by quarter but instead lists every record (so instead of having 45 records with different quarters over the past 10+ years, I all of a sudden have 13000+ records because it is listing each record with date_shipped in the query.

Can someone help please?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T14:16:42+00:00Added an answer on May 24, 2026 at 2:16 pm

    Try adding your filter in a WHERE clause:

    SELECT DISTINCTROW 
        Format$([InvoiceSub].[Date_Shipped],'\Qq yyyy') AS [Date_Shipped By Quarter]
    ,   Sum(InvoiceSub.Quantity) AS [Sum Of Quantity]
    FROM 
        InvoiceSub 
        INNER JOIN 
            Job_Book_Sub 
            ON (InvoiceSub.[Job #] = Job_Book_Sub.[Job #]) 
            AND (InvoiceSub.[LineItem#] = Job_Book_Sub.[LineItem#])
    WHERE
        Job_Book_Sub.[date_shipped] > Job_Book_Sub.[lineitem_duedate]
    GROUP BY 
        Format$([InvoiceSub].[Date_Shipped],'\Qq yyyy')
    ,   Year([InvoiceSub].[Date_Shipped]) * 4 + DatePart('q', [InvoiceSub].[Date_Shipped]) -1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having the toughest time writing in the function to hide numbers that are equal
Hey, I'm having the toughest time figuring out how to display this result. Say
Having a heckuva time with this one, though I feel I'm missing something obvious.
Having difficulty with getting Flowplayer to work nicely with RTMP. This is currently my
This is the toughest query I ever made: http://robertr.pastebin.com/X4bG4pFp SELECT `user`.`id` , `user`.`fname` ,
Having a issue where all mobile devices is zoomed 50% in at start. That
Having a problem getting a TreeView control to display node images. The code below
Having programmed through emacs and vi for years and years at this point, I
Having this route: map.foo 'foo/*path', :controller => 'foo', :action => 'index' I have the
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.