Qry not returning all records

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get this to give me all the categories in the LEBAEst_Cost I
have tried a number of things in the list first, last, sum, where etc and I
don't know enough about SQL/VBA to fix the problem. This report is
calculating a number of things right but it is not giving me ALL of the
records in the LEBAEst_Cost table.
Can anybody help?

SELECT qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.CategoryName, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
Sum(qryPurchaseOrderRpt.ExtendedPrice) AS SumOfExtendedPrice
FROM [EST_S-84a] INNER JOIN qryPurchaseOrderRpt ON [EST_S-84a].Category =
qryPurchaseOrderRpt.CategoryID
GROUP BY qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.CategoryName, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost
HAVING (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID?
Example:LEBA] & "*"));
 
Inner Joins return only records that have data in both tables. You may need
to change the join type to Left instead of Inner.
 
I changed that but it still isn't giving me all of the records. The budget

Pat Hartman(MVP) said:
Inner Joins return only records that have data in both tables. You may need
to change the join type to Left instead of Inner.
lmv said:
I am trying to get this to give me all the categories in the LEBAEst_Cost I
have tried a number of things in the list first, last, sum, where etc and
I
don't know enough about SQL/VBA to fix the problem. This report is
calculating a number of things right but it is not giving me ALL of the
records in the LEBAEst_Cost table.
Can anybody help?

SELECT qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.CategoryName, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
Sum(qryPurchaseOrderRpt.ExtendedPrice) AS SumOfExtendedPrice
FROM [EST_S-84a] INNER JOIN qryPurchaseOrderRpt ON [EST_S-84a].Category =
qryPurchaseOrderRpt.CategoryID
GROUP BY qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.CategoryName, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost
HAVING (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID?
Example:LEBA] & "*"));
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

HELP! Report SQL 6
Combine 2 Reports 2
STRUCTURE confused 5
UNION rpt?? 3
ALL Records needed 3
SUMs, totalling, but not totalling with every record.. 4
returning all records - not sure why! 1
Where > 0 4

Back
Top