May 19, 2015 at 7:35 am
Hi,
i have a new requirement to update existing report..requirement is ..
there are 3 columns in report
memberid,investorname and lendername...for each investor there are so many lenders..i got a requirement that if lendername='Bank of america' then investorname should display only 'Fannie mae'(There are also other investors for Bank of america but user is not concerned about that) ..user should not see other investornames...is there any way i can achieve this?..I tried using If statement but its not working..
May 19, 2015 at 8:37 am
You could use a case statement. this will bring back the investorname of fannie mae for all records with a lendername of bank of america.
you can try the syntax out in ssms first to see if you get the desired results.
select
memberid
,"investorname"=
case
when lendername='bank of america' then 'Fannie mae'
else [investorname]
,lendername
from sourcetable
Case statement reference page
May 19, 2015 at 9:02 am
THANKS..It Worked
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply