Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

SQL qry Report??

Discussion in 'Information Technology' started by lmv, Jul 28, 2006.

Tags:
  1. lmv

    lmv
    Expand Collapse
    Guest

    Can someone tell me how to take the following sql and adjust it so that the
    LEBAEst_Cost will only appear once per categoryID.
    The report has 3 columns Budget /Actual /Difference
    Budget is LEBAEst_Cost
    Actual is Extended Price
    and Difference is Actual -Difference
    There can be many items in one CategoryID that get totaled in the
    Actual /Extended Price I have a non visible text and then a visible txt over
    the top that is =Sum([ExtendedPrice]) in the CategoryID footer
    Then another 3 text boxes in MainID footer LEBAEst_Cost and
    =Sum([ExtendedPrice]) and the 3rd box is unbound at this time because I can't
    figure it out.

    This may be totally whacked but I don't know how to get this to total and I
    can't find an example to copy the idea from. My Actual is totalling correctly
    but the Budget is almost double what it should be and so of course the
    difference is wrong.

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

    Any help is appreciated
    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Microsoft Brings 64-Bit Perks in SQL Server 2000 Service Pack (Ziff Davis) Interfaith Dialogues May 7, 2005

Share This Page