View: dbo.Vendor_Bank_Transaction_View
View definition
`CREATE VIEW dbo.Vendor_Bank_Transaction_View AS SELECT bank_transaction_KEY = VT.bank_transaction_KEY , vendor_KEY = VT.vendor_KEY , CASE --Determine the payment type and return the corresponding key in Vendor_Payment_Method WHEN VT.bank_transaction_KEY IN (SELECT bank_transaction_KEY FROM dbo.Direct_Deposit_Bank_Transaction) THEN 2 --DirectDeposit WHEN VT.bank_transaction_KEY IN (SELECT bank_transaction_KEY FROM dbo.Eftps_Transaction) THEN 3 --EFTPS ELSE 1 --Check END AS vendor_payment_method_KEY , vendor_amortization_schedule_entry_KEY = VT.vendor_amortization_schedule_entry_KEY FROM dbo.Vendor_Bank_Transaction VT`