I have three tables in which two are reference tables and one main transaction table.
I have two columns in the Transaction table i.e. Proc_Code, Main_Code. I have to get the tariff information against these two codes from the reference tables.
I want to join the main transaction table with reference tables on the basis of the following conditions.
If tblTrans_OPCustomer.proc_code = tblRef_ProcedureCode.proc_code then get the tariff from tblRef_ProcedureCode (No need to check Main code)
If tblTrans_OPCustomer.proc_code <> tblRef_ProcedureCode.proc_code then get the tariff from tblRef_MainCode
How could I do this in Join conditions?
View Complete Post