Find ur modified code n use it
if(@OutTime is null and @InTime is not null)
begin
UPDATE Biometrics
SET [Name] =@Name, InTime =@InTime, Userid =@Userid, Group_Id=@Groupid where id=@id
end
else
begin
INSERT INTO Biometrics
([Name], InTime, Group_Id,Userid)
VALUES (@Name,@CheckTime,@Groupid,@Userid)
end
select top 1 @id=id from Biometrics where Userid=@Userid order by id desc
UPDATE Biometrics
SET [Name] = @Name, Group_Id = @Groupid, OutTime = @CheckTime, Duration=DateDiff(mi,@checktime,InTime) where id=@id
Hope it solves ur problems.
Dnt forget to click accpt ans and vote for it if it works for u.
Enjoy :)