SQL Server Performance

Multi Part Identifier could nott be bound

Discussion in 'SQL Server 2005 General DBA Questions' started by SquirrelJ, Nov 23, 2006.

  1. SquirrelJ New Member

    I have a query that selects a kit code and i wan to join this in with another query but am struggling to get it to work.

    This is my first query which works fine on its own.


    SELECT dbo.GSS_Kits.Kit_Code
    FROM dbo.GSS_Invoices INNER JOIN
    dbo.GSS_Kits ON dbo.GSS_Invoices.ItemNo = dbo.GSS_Kits.Kit_No

    This is my second query


    SELECT dbo.GSS_Invoices.ItemNo, dbo.GSS_Invoices.Cust_From, dbo.sites.Site AS Dest_Region, dbo.GSS_Export_Records.ETA, dbo.GSS_Invoices.Qty
    FROM dbo.sites INNER JOIN
    dbo.GSS_Invoices ON dbo.sites.Code = dbo.GSS_Invoices.Cust_To INNER JOIN
    dbo.GSS_Export_Records ON dbo.GSS_Invoices.Invoice_No = dbo.GSS_Export_Records.InvoiceNo


    What I am trying to do is put the first query into the second one so that Kit_code from the first query takes the place of invoices.itemno in the second query.


    Cheers for any help
  2. MohammedU New Member

    I didn't get your question but Try this...

    SELECT dbo.GSS_Invoices.ItemNo, dbo.GSS_Invoices.Cust_From, dbo.sites.Site AS Dest_Region,
    dbo.GSS_Export_Records.ETA, dbo.GSS_Invoices.Qty, dbo.GSS_Kits.Kit_Code
    FROM dbo.sites
    INNER JOIN dbo.GSS_Invoices ON dbo.sites.Code = dbo.GSS_Invoices.Cust_To
    INNER JOIN dbo.GSS_Kits ON dbo.GSS_Invoices.ItemNo = dbo.GSS_Kits.Kit_No
    INNER JOIN dbo.GSS_Export_Records ON dbo.GSS_Invoices.Invoice_No = dbo.GSS_Export_Records.InvoiceNo



    Mohammed U.

Share This Page