I Converted the follwing SQL Query into FetchXml
SELECT TOP (1) FilteredQuote.name, FilteredQuote.statecodename, FilteredQuote.totalamount, FilteredQuote.customeridname, FilteredQuote.quoteid, FilteredContact.address1_stateorprovince AS C_State, FilteredAccount.name AS A_FullName, FilteredSystemUser.address1_line3 AS O_Line3, FilteredSystemUser.address1_postalcode AS O_Zip, FilteredSystemUser.address1_city AS O_City, FilteredSystemUser.address1_stateorprovince AS O_State, FilteredSystemUser.personalemailaddress AS O_EMail, CASE FilteredSystemUser.preferredphonecode WHEN 2 THEN FilteredSystemUser.address1_telephone2 WHEN 3 THEN FilteredSystemUser.homephone WHEN 4 THEN FilteredSystemUser.mobilephone ELSE FilteredSystemUser.address1_telephone1 END AS O_Phone, FilteredSystemUser ON FilteredQuote.ownerid = FilteredSystemUser.systemuserid LEFT OUTER JOIN FilteredAccount ON FilteredQuote.customerid = FilteredAccount.accountid LEFT OUTER JOIN FilteredContact ON FilteredQuote.customerid = FilteredContact.contactid WHERE (FilteredQuote.quoteid = @CRM_QuoteId)
But i don't how to convert the CASE Statement to FetchXml from the above SQL query
CASE FilteredSystemUser.preferredphonecode WHEN 2 THEN FilteredSystemUser.address1_telephone2 WHEN 3 THEN FilteredSystemUser.homephone WHEN 4 THEN FilteredSystemUser.mobilephone ELSE FilteredSystemUser.address1_telephone1 END AS O_Phone,
sathishtech.IT