CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    [RESOLVED] The multi-part identifier could not be bound.

    Hi guys,

    I'm trying execute the statement below, but I keep getting the error:
    Msg 4104, Level 16, State 1, Line 1
    The multi-part identifier "SALESTABLE.SALESNUMBER" could not be bound.
    What am I doing wrong here?

    Code:
    SELECT SALESTABLE.*, SALESTRANS.*, DEBINVJOUR.*, EXCHANGECODERATE.*
    FROM SALESTRANS
    INNER JOIN DEBINVJOUR ON SALESTABLE.SALESNUMBER = DEBINVJOUR.SALESNUMBER
    INNER JOIN SALESTABLE ON SALESTRANS.SALESNUMBER = SALESTABLE.SALESNUMBER
    INNER JOIN EXCHANGECODERATE ON SALESTABLE.EXCHANGECODE = EXCHANGECODERATE.EXCHANGECODE
    WHERE SALESTABLE.DEBTORACCOUNT = ' 42914411'
    ORDER BY SALESTABLE.CREATEDATE
    Thanks in advance!
    It's not a bug, it's a feature!

  2. #2
    Join Date
    Oct 2008
    Location
    Richmond, VA
    Posts
    24

    Re: The multi-part identifier could not be bound.

    Seems like a lot of things could cause that.

    Not sure what it could be myself, but this was suggested for this error on another forum:

    1) Check all qualifiers (all owners and tables and columns are valid)
    2) Check that all derived tables has a name
    3) All columns in a derived table has a name



    in that example, the problem ended up being a case-sensitive issue
    he had RescAddon but it should have been RescAddOn


    ... hope that helps

  3. #3
    Join Date
    Nov 2007
    Location
    .NET 3.5 / VS2008 Developer
    Posts
    624

    Re: The multi-part identifier could not be bound.

    try this instead...

    Code:
    SELECT SALESTABLE.*, SALESTRANS.*, DEBINVJOUR.*, EXCHANGECODERATE.*
    FROM SALESTRANS
    INNER JOIN DEBINVJOUR ON SALESTRANS.SALESNUMBER = DEBINVJOUR.SALESNUMBER
    INNER JOIN SALESTABLE ON SALESTRANS.SALESNUMBER = SALESTABLE.SALESNUMBER
    INNER JOIN EXCHANGECODERATE ON SALESTABLE.EXCHANGECODE = EXCHANGECODERATE.EXCHANGECODE
    WHERE SALESTABLE.DEBTORACCOUNT = ' 42914411'
    ORDER BY SALESTABLE.CREATEDATE
    I changed the first inner join

  4. #4
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: The multi-part identifier could not be bound.

    Quote Originally Posted by eclipsed4utoo
    try this instead...

    Code:
    SELECT SALESTABLE.*, SALESTRANS.*, DEBINVJOUR.*, EXCHANGECODERATE.*
    FROM SALESTRANS
    INNER JOIN DEBINVJOUR ON SALESTRANS.SALESNUMBER = DEBINVJOUR.SALESNUMBER
    INNER JOIN SALESTABLE ON SALESTRANS.SALESNUMBER = SALESTABLE.SALESNUMBER
    INNER JOIN EXCHANGECODERATE ON SALESTABLE.EXCHANGECODE = EXCHANGECODERATE.EXCHANGECODE
    WHERE SALESTABLE.DEBTORACCOUNT = ' 42914411'
    ORDER BY SALESTABLE.CREATEDATE
    I changed the first inner join
    That seems to have done it Thanks!

    What was the nature of my error? I'm new to join-statements...
    It's not a bug, it's a feature!

  5. #5
    Join Date
    Dec 2006
    Posts
    203

    Re: The multi-part identifier could not be bound.

    You wrote SALESTABLE instead of SALESTRANS in the first INNER JOIN.
    Sincerely,

    Martin Svendsen

  6. #6
    Join Date
    May 2007
    Location
    Denmark
    Posts
    623

    Re: The multi-part identifier could not be bound.

    Thanks,

    looking at my first query that seems really obvious now
    It's not a bug, it's a feature!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured