kankon says:
YEAR
(datestart) =
YEAR
(GETDATE())
You are passing GETDATE() as hard coded value. So it will check with current year. You need to pass @datestart variable inplace of GETDATE().
ALTER PROCEDURE [dbo].[GetDetails]
@id INT = NULL
,@idnamev nvarchar(MAX) = NULL
,@namevacation nvarchar(MAX) = NULL
,@idcivilv nvarchar(MAX) = NULL
,@infovacation nvarchar(MAX) = NULL
,@datestart datetime = NULL
,@dateend datetime = NULL
,@vacationdata datetime = NULL
,@el3malv nvarchar(MAX) = NULL
,@datesp10 nvarchar(MAX) = NULL
,@eldarajah nvarchar(MAX) = NULL
,@totalva nvarchar(MAX) = NULL
,@jop nvarchar(MAX) = NULL
,@name nvarchar(MAX) = NULL
,@ContentType nvarchar(MAX) = NULL
,@backupmyfile varbinary(MAX) = NULL
AS
BEGIN
SELECT Id, idnamev, namevacation, idcivilv, infovacation, datestart, dateend,vacationdata,el3malv,datesp10,eldarajah,totalva,jop,name,ContentType,backupmyfile
FROM Table_vacation
WHERE (YEAR(datestart) = YEAR(@datestart) OR ISNULL(@datestart,'') = '')
AND (datestart = @datestart OR ISNULL(@datestart,'') = '')
AND (namevacation = @namevacation OR ISNULL(@namevacation,'') = '')
END