G
Guest
I have 2 reports (code included) I can get them both to work seperately but I
need a report that will combine the info.
The Cost in the EST_S84 needs to then subtract the info in the extendedprice
field to make the "difference" field which I guess would be
=[LEBAEst_Cost]-[ExtendedPrice] but I get null errors and it isn't totalling
the info right. (Though I don't know the diffence between
=[LEBAEst_Cost]-[ExtendedPrice]
=Sum ([LEBAEst_Cost]-[ExtendedPrice])
Which returns different results. But I don't know why.
I have tried to put the 2 qry's into one but it doesn't work. Also, the MAIN
category field is the 260, 270, 280 etc BUT sometimes there is currency in
those fields so I had thoght of making an unbound 260TTL field that would
calculate since these figures do not need to be stored. If I haven't included
enough information please let me know as I only have a couple of days to get
this figured out.
THANKS so much!
--------------Budget ESTIMATED SQL
SELECT DISTINCT [EST_S-84a].Category, [EST_S-84a].LEBAEst_Cost,
qryCategoryLookup.CategoryName, qryCategoryLookup.MainCatID,
qryCategoryLookup.MainCatName
FROM [EST_S-84a] INNER JOIN qryCategoryLookup ON [EST_S-84a].Category =
qryCategoryLookup.CategoryID
ORDER BY [EST_S-84a].Category;
----------BUDGET SPENT
SELECT qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.MainCatID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.MainCatName, qryPurchaseOrderRpt.ExtendedPrice
FROM qryPurchaseOrderRpt
WHERE (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID? Example:LEBA]
& "*"));
The code I tried below that doesn't work ON ALL RECORDS... if there is only
1 record in the extendedPrice it works If there are numerous records then
each record gets an estimated line and that is wrong as the category should
only have 1 instance of the amount but I don't know how to combine the
DISTINCT into the SQL
SELECT qryPurchaseOrderRpt.CategoryID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
Sum(qryPurchaseOrderRpt.ExtendedPrice) AS SumOfExtendedPrice
FROM [EST_S-84a] RIGHT JOIN qryPurchaseOrderRpt ON [EST_S-84a].Category =
qryPurchaseOrderRpt.CategoryID
GROUP BY qryPurchaseOrderRpt.CategoryID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
qryPurchaseOrderRpt.OrderID
HAVING (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID?
Example:LEBA] & "*"));
need a report that will combine the info.
The Cost in the EST_S84 needs to then subtract the info in the extendedprice
field to make the "difference" field which I guess would be
=[LEBAEst_Cost]-[ExtendedPrice] but I get null errors and it isn't totalling
the info right. (Though I don't know the diffence between
=[LEBAEst_Cost]-[ExtendedPrice]
=Sum ([LEBAEst_Cost]-[ExtendedPrice])
Which returns different results. But I don't know why.
I have tried to put the 2 qry's into one but it doesn't work. Also, the MAIN
category field is the 260, 270, 280 etc BUT sometimes there is currency in
those fields so I had thoght of making an unbound 260TTL field that would
calculate since these figures do not need to be stored. If I haven't included
enough information please let me know as I only have a couple of days to get
this figured out.
THANKS so much!
--------------Budget ESTIMATED SQL
SELECT DISTINCT [EST_S-84a].Category, [EST_S-84a].LEBAEst_Cost,
qryCategoryLookup.CategoryName, qryCategoryLookup.MainCatID,
qryCategoryLookup.MainCatName
FROM [EST_S-84a] INNER JOIN qryCategoryLookup ON [EST_S-84a].Category =
qryCategoryLookup.CategoryID
ORDER BY [EST_S-84a].Category;
----------BUDGET SPENT
SELECT qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.CategoryID,
qryPurchaseOrderRpt.MainCatID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.MainCatName, qryPurchaseOrderRpt.ExtendedPrice
FROM qryPurchaseOrderRpt
WHERE (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID? Example:LEBA]
& "*"));
The code I tried below that doesn't work ON ALL RECORDS... if there is only
1 record in the extendedPrice it works If there are numerous records then
each record gets an estimated line and that is wrong as the category should
only have 1 instance of the amount but I don't know how to combine the
DISTINCT into the SQL
SELECT qryPurchaseOrderRpt.CategoryID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
Sum(qryPurchaseOrderRpt.ExtendedPrice) AS SumOfExtendedPrice
FROM [EST_S-84a] RIGHT JOIN qryPurchaseOrderRpt ON [EST_S-84a].Category =
qryPurchaseOrderRpt.CategoryID
GROUP BY qryPurchaseOrderRpt.CategoryID, qryPurchaseOrderRpt.CategoryName,
qryPurchaseOrderRpt.ProjectID, qryPurchaseOrderRpt.MainCatID,
qryPurchaseOrderRpt.MainCatName, [EST_S-84a].LEBAEst_Cost,
qryPurchaseOrderRpt.OrderID
HAVING (((qryPurchaseOrderRpt.ProjectID) Like [What Project ID?
Example:LEBA] & "*"));