locked
SQL eror RRS feed

  • Question

  • We are using Goldmine 6.7 & we are getting this error when usig the filters, please help

    General SQL error.
    Native SQL error: 209

    Context: SQLQuery: GoldMine:
    SELECT c1.Company,c1.Contact,c1.RecID,c1.owner,c1.status, c1.AccountNo, c2.AccountNo FROM dbo.CONTACT1 c1 (NOLOCK), dbo.CONTACT2 c2 (NOLOCK) WHERE ((c2.COMMENTS = 'JUNE09' AND  c1.U_KEY4 = 'ANUVIND') AND (c1.ACCOUNTNO = c2.ACCOUNTNO)) ORDER BY ACCOUNTNO

    1: Server message: Ambiguous column name 'ACCOUNTNO'.

    BDE Error Cat:Code: [51:3]
    BDE: 500 [4/11/1999]  GoldMine: 6.70.70226

    User: ANUVIND 
    Window: Filters and Groups
    &Cancel

    Template:
    Details:
    NATIVEMSG: Ambiguous column name 'ACCOUNTNO'.

    Wednesday, July 1, 2009 2:56 PM

Answers

  • Use an alias in the "order by" clause to tell sql server exactly the column you want to use.

    ...
    order by c1.ACCOUNTNO


    Also, in the column list of the select, try to diffnrentiate both columns (this is not the problem).

    select ..., c1.AccountNo as c1_AccountNo, c2.AccountNo as c2_AccountNo, ...

    AMB
    • Marked as answer by Zongqing Li Thursday, August 20, 2009 7:33 AM
    Wednesday, July 1, 2009 3:01 PM