Welcome to SPN

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

Sign Up Now!

Qry not returning all records

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

  1. lmv

    lmv
    Expand Collapse
    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] & "*"));
     
  2. Loading...

    Similar Threads Forum Date
    Christianity The Path of Returning to God Interfaith Dialogues Feb 6, 2011
    Returning to SPN Announcements Nov 2, 2006
    Returning to sikhi, actually... Announcements Feb 14, 2006
    Christianity will religions join with the returning of Jesus? Interfaith Dialogues Jun 28, 2005

  3. Pat Hartman\(MVP\)

    Pat Hartman\(MVP\)
    Expand Collapse
    Guest

    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" <lmv@discussions.microsoft.com> wrote in message
    news:96A9A345-E010-486F-8804-AA10C31B2F3E@microsoft.com...
    >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] & "*"));
    >
     
  4. lmv

    lmv
    Expand Collapse
    Guest

    I changed that but it still isn't giving me all of the records. The budget

    "Pat Hartman(MVP)" wrote:

    > 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" <lmv@discussions.microsoft.com> wrote in message
    > news:96A9A345-E010-486F-8804-AA10C31B2F3E@microsoft.com...
    > >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] & "*"));
    > >

    >
    >
    >
     

Share This Page