The multi-part identifier "Members.MemberID_" could not be bound.

  • Hi

    When runing queries I keep geting the above error.

    Does anyone know how to resolve this pls?

    thanks

  • philip.davy (5/16/2013)


    Hi

    When runing queries I keep geting the above error.

    Does anyone know how to resolve this pls?

    thanks

    Can you post the code you are running?

    Somewhere in this code you are using "Members.MemberID_", but your table Members (or table refereed by this alias) has no "MemberID_" column.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • select

    List_,

    Description,

    count(month(TimeClicked)) as MonthTimeClicked

    from clicktracking_ with (nolock)

    inner join members_ on clicktracking_.MemberID_ = Members_.MemberID_

    inner join lyrLookupCompletionStatus on lyrCompletedRecips.CompletionStatusID = lyrLookupCompletionStatus.CompletionStatusID

    group by

    List_,

    Description

  • philip.davy (5/16/2013)


    select

    List_,

    Description,

    count(month(TimeClicked)) as MonthTimeClicked

    from clicktracking_ with (nolock)

    inner join members_ on clicktracking_.MemberID_ = Members_.MemberID_

    inner join lyrLookupCompletionStatus on lyrCompletedRecips.CompletionStatusID = lyrLookupCompletionStatus.CompletionStatusID

    group by

    List_,

    Description

    Query you posted refers to the table with name "Members_"

    Error shows "Members" - no underscore at the end.

    Actually, you have a very strange naming convention...

    Why do you add underscore at the end of some table and its columns names?

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • philip.davy (5/16/2013)


    select

    List_,

    Description,

    count(month(TimeClicked)) as MonthTimeClicked

    from clicktracking_ with (nolock)

    inner join members_ on clicktracking_.MemberID_ = Members_.MemberID_

    inner join lyrLookupCompletionStatus on lyrCompletedRecips.CompletionStatusID = lyrLookupCompletionStatus.CompletionStatusID

    group by

    List_,

    Description

    lyrCompletedRecips.CompletionStatusID = lyrLookupCompletionStatus.CompletionStatusID

    This will fail unless you have lyrCompletedRecips in your FROM list.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • The naming convention was decided by someone else

  • philip.davy (5/16/2013)


    The naming convention was decided by someone else

    Have you figured out the query issues, Philip?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Sorry, afraid not

    thanks

  • I don't see it in the query, but as Eugene suggested, the error implies you had members.memberid_ in the query somewhere.

    I'd double check that.

  • Yes I've corrected that

  • philip.davy (5/16/2013)


    Sorry, afraid not

    thanks

    If you are still interested in working it through, there are folks here willing to help.

    There are two or three remaining issues with the query;

    you have a reference to a table lyrCompletedRecips, in a join, which isn't in the FROMlist

    table lyrLookupCompletionStatus isn't joined to any tables in the FROMlist which will result in a cartesian product (too many rows)

    the aggregate probably won't generate the result you are expecting.

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden

  • Maybe I'm missing something but perhaps all this procedure needs is to make sure the table and column names are enclosed in brackets ([]) due to the odd naming convention.

     

Viewing 12 posts - 1 through 11 (of 11 total)

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