Search code examples
sql-server-2008dynamics-crm-4

Query Error when use pre-filtering CRMAF_


I have a query in SQL

    SELECT  ses_student.ses_studentId ,
    ses_student.ses_Student ,
    ses_student.ses_StudentName ,
    col_StudentInvoicePayments.TrxID ,
    col_StudentInvoicePayments.TrxNo ,
    col_StudentInvoicePayments.TrxDate ,
    col_StudentInvoicePayments.Name ,
    col_StudentInvoicePayments.TotalAmount
FROM    ses_student AS CRMAF_ses_student
        INNER JOIN col_StudentInvoicePayments ON dses_student.ses_studentId = col_StudentInvoicePayments.ses_StudentId 

It gives error multiple identifier ses_student.ses_studentId and ses_student.ses_Student

this error occur when I use pre filter "AS CRMAF_ses_student" because it sis CRM DataBase


Solution

  • Please try this updated query....

    SELECT  CRMAF_ses_student.ses_studentId ,
            CRMAF_ses_student.ses_Student ,
            CRMAF_ses_student.ses_StudentName ,
            col_StudentInvoicePayments.TrxID ,
            col_StudentInvoicePayments.TrxNo ,
            col_StudentInvoicePayments.TrxDate ,
            col_StudentInvoicePayments.Name ,
            col_StudentInvoicePayments.TotalAmount
    FROM    ses_student AS CRMAF_ses_student
            INNER JOIN col_StudentInvoicePayments ON CRMAF_ses_student.ses_studentId = col_StudentInvoicePayments.ses_StudentId