If condition in Reports

  • 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..

  • 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

    https://msdn.microsoft.com/en-us/library/ms181765.aspx

  • 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