Left Outter Join Confusion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ShelleyCook
    New Member
    • Sep 2010
    • 1

    Left Outter Join Confusion

    I have one table with the majority of the information. This table holds the following:
    SalesRep (lookup from another table)
    Invoice Date
    Date Paid
    OE
    Customer
    NetSale
    GP
    Adj GP
    Rate
    Paid Amount
    Paid in full?
    Additional Notes
    Commission Payout Date
    Bonus Amount

    I have a query that calculates the commission by multiplying the rate times the GP (gross profit). My supervisor wants this report to list all Sales Reps even if they did not sell anything. At this point, I have a box pop up and ask me for the date paid and the report is generated. I have tried doing a basic left join from my SalesRep table to the table I outlined above (joining to the 'salesrep' field. For some reason, the left join is not being enforced and the sales reps names are not appearing if they do not have any sales for the period. If anyone can help, that'd be great!!
  • hype261
    New Member
    • Apr 2010
    • 207

    #2
    Can you post the code for your sql query? That would help people to solve your problem.

    Comment

    • Stewart Ross
      Recognized Expert Moderator Specialist
      • Feb 2008
      • 2545

      #3
      The SQL would certainly help, as hype261 asked.

      Even without the SQL posted, though, I'm certain you will find that you've negated your left join through the use of the pop-up which filters the data for the date paid. This is bound to exclude the sales reps who have no sales in that period, as they have no sales and therefore the dates, commission and so on are null in those cases. You could try changing the filter so that it is something like

      Code:
      <existing WHERE clause> OR [Commission Payout Date] IS NULL
      -Stewart

      Comment

      Working...