January 10, 2019 at 1:24 am
Create PROCEDURE [dbo].[UpdateAttendance3]
-- Add the parameters for the stored procedure here
@INTIME DateTime,
@OUTTIME DateTime
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
Update EmployeesAttendance
set EmployeesAttendance.INTIME=@INTime,
EmployeesAttendance.OUTTIME=@OUTTIME,
EmployeesAttendance.Hours ( (DATEDIFF(Hour,INTIME,OUTTIME))),
EmployeesAttendance.Day( CASE WHEN EmployeesAttendance.Hours >= 8 THEN 1
WHEN EmployeesAttendance.Hours = 0 THEN 0
WHEN EmployeesAttendance.Hours >= 6 THEN 0.5 end),
EmployeesAttendance.OT(CASE WHEN EmployeesAttendance.Hours > EmployeeDetails.Dhour then
EmployeesAttendance .Hours - EmployeesAttendance .Dhour else 0 End),
EmployeesAttendance.OTAmount(CASE when EmployeeDetails.OTEntitled = 'Yes'
AND EmployeesAttendance .Hours >= EmployeeDetails.Dhour
THEN (( EmployeesAttendance.Hours - 8) * 100) else 0 END ),
EmployeesAttendance.Time( Convert(varchar(10), EmployeesAttendance .INTIME,108),
EmployeesAttendance.Late(Case When Convert(Time, EmployeesAttendance .INTIME,108) > EmployeeDetails.LTime Then 1 else 0
end
From EmployeeDetails
Left Join EmployeesAttendance ON EmployeeDetails.EmpId = EmployeesAttendance.EmpID
-- Order by EmployeeDetails.EmpID asc
where EmployeesAttendance.AttdID=EmployeesAttendance.AttdID
End
Getting Error when creating SP,,,Please Help me out...
Msg 156, Level 15, State 1, Procedure UpdateAttendance3, Line 34
Incorrect syntax near the keyword 'From'
January 10, 2019 at 1:49 am
You're missing )) (two close brackets) after the END, just before the FROM
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy