I have a report in crystal that I'm trying to duplicate in SQL reporting. It displays various information about projects. One of the fields in the report is Expected Contract, depending on what contract type is this information can be found in 3 differnt fields.
The contract field type is JC00102.Contract_Type, it can have a value of 1,2, or 3.
The dollar amount is in the corresponding fields based on contract type
If contract_type =1 dollar amount is in JC00102.Expected_Contract
If contract_type =2 dollar amount is in JC00107.User_Defined_Dollar_1
If contract_type =3 dollar amount is in JC00102.Contract_Max_Bill_Amt
I have one table cell that I need to display the "Expected Contract" based on the information above. How can I do this in SQL Syntax? I'm pretty sure I need to use IIF but not 100% sure.