Error?

  • Your SQL is invalid: The multi-part identifier "Ordersdetails.ProductCode" could not be bound.

    Here was my Code

    SECET

    Orders.CustomerId,

    Orders.Salesrep_Customerid,

    Orders.Custom_field_vehicleinfo,

    Orders.Salesrep_Customerid,

    OrderDetails.ProductCode,

    OrderDetails.Quantity

    FROM Orders

    JOIN Orderdetails

    ON orders.orderid = orderdetails.orderid

    WHERE Ordersdetails.ProductCode Like ('Upgrade%')

    ORDER BY Orders.Salesrep_Customerid ASC

    Should it be in instead of Like because i need it to select all the product codes that contain the word upgrade in it. because there are diferant numbers following it.

    You guys have been an amazing help thank you

  • Look for the extra s..

    Ordersdetails.ProductCode

    CEWII

  • Justin 17041 (1/19/2011)


    JOIN Orderdetails

    ON orders.orderid = orderdetails.orderid

    WHERE Ordersdetails.ProductCode Like ('Upgrade%')

    ORDER BY Orders.Salesrep_Customerid ASC

    Should it be in instead of Like because i need it to select all the product codes that contain the word upgrade in it. because there are diferant numbers following it.

    In matches a list of exact values. The LIKE will match all rows where product code starts with "Upgrade"

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply