I want to add inner joinin which "IsParcelAllotment='N' " and where i have to apply
ALTER PROCEDURE [dbo].[store procedure name]
@SData nvarchar(50),
@ID bigint,
@DID int ,
@User varchar(50)
AS
BEGIN
SELECT [RowID]
,[FID]
,[IID]
,[IsComplete]
,CONVERT(VARCHAR(10),comm_Table1.CreateDate,103) as CreateDate
,comm_Table1.ChangeDate
,[CurrentStatus]
,[StatusDate]
FROM [MedleaprLab].[dbo].[comm_Table1]
where FID like '%'+@SData+'%' and IID=@IID and [DID]=@DivisionID and CurrentHOD=@User
and
FID not in (select top 1 FID from comm_Table2 where FID like '%'+@SData+'%' and IsParcelAllotment='Y' )
and
FID not in(
select FNo from
(
select isnull(COALESCE(RDetails,PDetail,PaDetail,EDetail,NWhom,pdetail,cdetail,ahod),0) as Value,FslCaseNo from Table3 ) as temp
where Value <> 1
)
END