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

  • Home
  • SEARCH
  • 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 8848199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:22:14+00:00 2026-06-14T12:22:14+00:00

When I try limiting my results, I limit them too much. Select Distinct Agreements.AgrmntID,

  • 0

When I try limiting my results, I limit them too much.

Select Distinct Agreements.AgrmntID, Agreements.Status, JobSites.SiteName,
  AgreementCharges.TotalSaleAmt, AgreementCharges.PartID,
  AgreementSchedules.FormanEmpID, LaborCodeTypes.RepairCode
From Agreements Inner Join
  AgreementCharges On Agreements.AgrmntID = AgreementCharges.AgrmntID Inner Join
  JobSites On JobSites.CustSiteID = Agreements.CustSiteID Left Outer Join
  AgreementSchedules On Agreements.AgrmntID = AgreementSchedules.AgrmntID
  Left Outer Join
  LaborCodeTypes On LaborCodeTypes.RepairID = AgreementSchedules.RepairID
Where Agreements.Status = 2 And AgreementCharges.PartID = 31 And
  LaborCodeTypes.RepairCode = '04 - LS'

If there is no RepairCode matching ’04 – LS’ I still need the AgrmntID and TotalSaleAmt. Likewise, if there is no AgreementSchedule at all, I need AgrmntID and TotalSaleAmt.

Output:

AgrmntID  Status  SiteName  TotalSaleAmt  PartID  FormanEmpID  RepairCode
-------------------------------------------------------------------------
2         2       TEST01    $100.00       31      66           04 - LS
2         2       TEST03    $300.00       31      21           04 - LS

Expected Output:

AgrmntID  Status  SiteName  TotalSaleAmt  PartID  FormanEmpID  RepairCode
-------------------------------------------------------------------------
2         2       TEST01    $100.00       31      66           04 - LS
2         2       TEST02    $200.00       31
2         2       TEST03    $300.00       31      21           04 - LS

I’ve looked and looked and am now coming here for help. Thank you in advance!!

  • 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-06-14T12:22:15+00:00Added an answer on June 14, 2026 at 12:22 pm

    This is what ended up working:

    Select Distinct Agreements.AgrmntID, Agreements.Status, JobSites.SiteName,
      AgreementCharges.TotalSaleAmt, AgreementCharges.PartID, a.FormanEmpID,
      a.RepairCode
    From Agreements Inner Join
      JobSites On JobSites.CustSiteID = Agreements.CustSiteID Left Join
      AgreementCharges On Agreements.AgrmntID = AgreementCharges.AgrmntID Left Join
      (Select AgreementSchedules.AgrmntID, AgreementSchedules.FormanEmpID,
          b.RepairCode
        From AgreementSchedules Inner Join
          (Select LaborCodeTypes.RepairCode, LaborCodeTypes.RepairID
            From LaborCodeTypes) b On AgreementSchedules.RepairID = b.RepairID
        Where b.RepairCode = '04 - LS') a On Agreements.AgrmntID = a.AgrmntID
    Where Agreements.Status = 2 And AgreementCharges.PartID = 31
    

    Thank you very much pkuderov, your response kept pointing me in the right direction. And think you kiwirichard, even though you deleted your response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to limit the number of allowable characters to 5 by using try
Try this code - import java.io.StringReader; public class StringReaderTest { public static void main(String[]
Try this piece of code - public class WhitespaceTest { public static void main(String[]
try { if (myBoolean) { while (true) ; } else { System.exit(1); } }
try: html = urlopen('http://glbse.com/api/asset/' + asset.name) except: print 'error while updating the price of
try: recursive_function() except RuntimeError e: # is this a max. recursion depth exceeded exception?
try { JSONArray jArray = new JSONArray(result); for(int i=0;i<jArray.length();i++) { JSONObject json_data = jArray.getJSONObject(i);
try { $friends = $facebook->api('/me/friends'); } catch (FacebookApiException $e) { error_log($e); } Shows :Fatal
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals
Try as I might I cannot get my head around what the IteratorIterator class

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.