I have the following query
Select NgoName As "NGO",
dbo.FormatToIndianCurrency(TotalRaised) As "Total Raised"
From tblNgoDailyReciepts2013 tnd with (nolock)
inner join manufacturer mfi with (nolock) on tnd.NgoName=mfi.Name
where mfi.name in (@Ngolist)
Order By TotalRaised desc
I am passing a set of comma separated string as part of the @Ngolist parameter. The query seems to work fine as long as there is no & as part of the @Ngolist so for example it works fine with mfi.name in ('A','B') . However if I have an ampersand the results are not what are expected.
So for example if I have mfi.name in ('A&Company','B') it does not produce the correct result.
Any ideas on how I can go about fixing this ?