Results 1 to 2 of 2
  1. #1
    JDPrestige is offline Novice
    Windows 7 Access 2003
    Join Date
    Nov 2010
    Posts
    3

    Pass Through Query Summing Problem

    Hi All,

    I have a Pass Through Query called "qryDrivera2", the SQL is this:
    SELECT tblLocal.LoadLineID, tblLocal.Suburb, tblContract.Contract, tblLocal.Yard, tblLocal.BrickType, tblLocal.Qty, tblLocal.DeliveryDate, tblLocal.Plant, tblLocal.SpecialReq, tblLocal.TruckType, tblLocal.AreaKlm, tblLocal.Pallets, tblContract.ContractID, tblLocal.LoadBoxNo, tblLocal.DriverNo, tblLocal.Basket, tblLocal.JDNo, tblLocal.Driver, tblLocal.LoadBoxNo, tblLocal.Allocated, tblLocal.Abbrev, tblLocal.Confirmed, tblLocal.ConfirmedLoad, Case when [tblLocal].[Abbrev] Is Null then [Plant] else [tblLocal].[Abbrev] end AS Abbrev2, tblContract.Abbrev, tblLocal.DeliverySlot, tblLocal.Builder, tblLocal.MinQty, tblLocal.TruckNo
    FROM tblLocal INNER JOIN tblContract ON tblLocal.ContractID = tblContract.ContractID
    WHERE tblLocal.LoadBoxNo = 1


    I am trying to sum the fields Qty & Pallets from this query in another Pass Through Query called qryDrivera2SUM, this SQL is this:

    SELECT Sum(qryDrivera2.Qty) AS SumOfQty, Sum(qryDrivera2.Pallets) AS SumOfPallets
    FROM qryDrivera2;


    When i attempt to run qryDrivera2SUM, i keep getting the following error:

    ODBC -call failed
    [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'qryDrivera2'. (#208)

    Can anyone see what i'm doing wrong in qryDrivera2SUM?


    I've been pulling my hair out with this one!!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    qryDrivera2 is the query's name within Access. When you use it in a pass through query, SQL Server doesn't know what it is. Just make the second one an Access query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Pass-Through Query or ADO, is there a way?
    By Amber_1977 in forum Queries
    Replies: 3
    Last Post: 11-10-2010, 08:56 AM
  2. Opinions on PL/SQL and pass through query
    By thart21 in forum Queries
    Replies: 5
    Last Post: 06-02-2010, 11:08 PM
  3. Pass a value from a query to a form
    By cwwaicw311 in forum Forms
    Replies: 22
    Last Post: 03-22-2010, 10:21 AM
  4. Pass a Parameter From a form to a Query
    By DDillesha in forum Forms
    Replies: 1
    Last Post: 10-28-2009, 12:49 PM
  5. I want to automatically pass a value to a query
    By Slategrey252 in forum Queries
    Replies: 1
    Last Post: 10-01-2009, 05:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums