Bonjour,
Je dois écriture une procédure stockée dans laquelle je passe un paramètre varchar que j'utilise dans une instruction IN.
Cette procédure est appelée dans un reporting services.
Lorsque je sélectionne des valeurs mutliples pour le paramètre @RessourceNo, le requête ne renvoie pas de données.
Merci pour votre aide.
Voici le code :
ALTER PROCEDURE [dbo].[SuiviActivite2]
-- Add the parameters for the stored procedure here
(@DateDeb datetime,@DateFin datetime,@RessourceNo varchar(250))
AS
BEGIN
SELECT RES.No_ as RessourceNo,
TypeAffaire = case left([Avenir Productique$Job].No_,2)
WHEN 'AF' THEN 'AFFAIRE'
WHEN 'CE' THEN 'AFFAIRE'
WHEN 'GE' THEN 'GESTION'
WHEN 'R&' THEN 'R&D'
WHEN 'RE' THEN 'RECUP'
WHEN 'CP' THEN 'CP'
else 'AUTRE TYPE'
END,SUM([Avenir Productique$Res_ Ledger Entry].Quantity) as HeuresATPROD, 0 as HeuresINTPROD,0 as HeuresETUPROD, 0 as HeuresDEPPROD, 0 as HeuresFORPROD, 0 as HeuresAUTPROD, 0 as HNOR
INTO #TSuiviActivite
FROM [Avenir Productique$Resource] RES (nolock) INNER JOIN [Avenir Productique$Res_ Ledger Entry] (nolock) ON
RES.No_ = [Avenir Productique$Res_ Ledger Entry].[Resource No_]
INNER JOIN [Avenir Productique$Job] (nolock) ON
[Avenir Productique$Job].No_ = [Avenir Productique$Res_ Ledger Entry].[Job No_]
INNER JOIN [Avenir Productique$Ledger Entry Dimension] (nolock) ON
[Avenir Productique$Ledger Entry Dimension].[Entry No_] = [Avenir Productique$Res_ Ledger Entry].[Entry No_]
WHERE [Avenir Productique$Res_ Ledger Entry].[Posting Date] between @DateDeb AND @DateFin AND
RES.No_ IN (@RessourceNo) AND
[Avenir Productique$Res_ Ledger Entry].[Entry Type] = 0 AND
[Avenir Productique$Ledger Entry Dimension].[Table ID] = 169 AND
[Avenir Productique$Ledger Entry Dimension].[Dimension Code] = 'FAMILLE' AND
[Avenir Productique$Ledger Entry Dimension].[Dimension Value Code] = 'AT'
GROUP BY RES.No_, left([Avenir Productique$Job].No_,2)