I have a parameterized query shown below that is supposed to return info about items that have a name like the parameter. However, it only works for exact matches
BEGIN
SET NOCOUNT ON
DECLARE @name varchar(50)
SET @name = 'bananas'
SELECT category, sum(netweight) AS NetWeight from PieChart group by
category, name HAVING name LIKE @name
END
Since 'bananas' is in the database, it returns that info. If it put 'banan', it returns nothing.
Thanks for your help!