question

Rachel avatar image
Rachel asked

Getting error: Invalid column name 'v_mv_Loan'

Am trying to convert from an access query into sql. Any help is appreciated. Thanks!

SELECT v_mv_FANote.BranchName, v_mv_FANote.FANoteDateAdded, v_mv_Loan.LoanLastRenewedDate, v_mv_FANote.BranchNbr, v_mv_FANote.BENbr, v_mv_FANote.CustomerBusinessFNameLName, v_mv_FANote.FarmTypeID, v_mv_FANote.FANoteSourceCustomerNoteNbr, v_mv_Loan.LoanInstanceNbr, v_mv_FANote.FAStatusTypeID, v_dv_NoteCode_085.GLCode, v_mv_Loan.LoanCurrPrinBal, v_mv_FANote.RiskRatingCode, v_mv_FANote.FANoteCreditRiskRatingDate, v_mv_FANote.LGDCodeAbbr, v_mv_FANote.FANoteCreditLGDDate, v_mv_FANote.FANoteCreditSoldRiskRatingAmt, v_mv_FANote.ServicingLoanOfficerCode, v_mv_FANote.GuaranteeOrgName, Case WHEN (v_mv_Loan.LoanLastRenewedDate IS NULL) THEN v_mv_FANote.FANoteDateAdded ELSE Case WHEN (v_mv_FANote.FANoteDateAdded>v_mv_Loan.LoanLastRenewedDate) THEN v_mv_FANote.FANoteDateAdded ELSE v_mv_FANote.v_mv_Loan.LoanLastRenewedDate END END AS Date FROM v_mv_FANote INNER JOIN v_mv_Loan ON v_mv_FANote.FAID = v_mv_Loan.FAID AND v_mv_FANote.SnapshotID = v_mv_Loan.SnapshotID INNER JOIN v_dv_NoteCode_085 ON v_mv_Loan.ACAID = v_dv_NoteCode_085.ACAID AND v_mv_Loan.SnapshotID = v_dv_NoteCode_085.SnapshotID

sql-server-2008ssrs
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
TG avatar image
TG answered

You have two different tables aliasing this column in your CASE statement:

ELSE v_mv_FANote.v_mv_Loan.LoanLastRenewedDate            
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.