Does anyone know why I'm getting no values from this query when I am trying to give a parameter with two values in it? Like the first parameter? When I'm trying it with only one value it works?
SELECT * FROM amountStatistikFN('1111,2222','2020','10001','1' )
SQL-Function:
ALTER FUNCTION appAmountStatistikFN
(
@client nvarchar(25),
@year nvarchar(25),
@persnr nvarchar(25),--
@location nvarchar(25)
)
RETURNS TABLE
AS
RETURN
(
SELECT persnr, client, location, activity, year, SUM(amount) AS Summe
FROM app_hours
WHERE
persnr IN (@persnr) AND year=2020 AND location IN (@location) AND client IN (@client)
GROUP BY persnr, client, location, activity, year
)
GO