How can I convert this inline SQL to a stored procedure
SELECT
PM.ProjectName
,[PurposeorReason]
,Reg.Name
,EA.Comment as Comment
,[FromDate]
,[VoucherID]
,[TotalAmount]
,ex.CreatedOn
FROM [TimesheetDB].[dbo].[Expense] ex
inner join Registration Reg on reg.RegistrationID = ex.UserID
inner join ProjectMaster PM on ex.ProjectID =PM.ProjectID
inner join AssignedRoles AR on reg.RegistrationID = AR.RegistrationID
inner join ExpenseAuditTB EA on ex.ExpenseID = EA.ExpenseID
where FromDate between '2019-09-25' and '2019-09-29'
and ea.ProjectID IN (1,2,5)
and EA.Status = 2
I have issues with the (1,2,5) part. I have it in C# as a string "1,2,5" and the ProjectID is integer.
I know I am doing something wrong. The query itself works well.