-
Apr 20th, 2017, 03:10 PM
#1
Thread Starter
Enjoy the moment
[RESOLVED] working hours problem
hey
i have a employee that enters in and out twice every day
the first enter in and out works find and calculates the minutes
but when he enters back in and enters out
the total minutes dosnt calculate it.only the first and second enter
need some help please
this is my code
Code:
CN.Execute "Update Enterwork SET [EnterTotal]=DateDiff(""n"", [EnterIn],[EnterOut]) + DateDiff(""n"", [EnterIN1],[EnterOut2]) WHERE [EnterID]= " & EnterEmpID
regards
salsa31
-
Apr 20th, 2017, 03:21 PM
#2
Re: working hours problem
At a glance it looks like it should work though I would probably not do it that way.
What result are you actually getting?
Can't tell from your description as you say only the first and second enter which logically would mean the first shift and the second shift which would be all of it but then you use the word enter everywhere so it is kind of meaningless.
It would make a lot more sense if it was named according to what they actually mean, like
tblTimeClock EmpID, TimeIn, TimeOut, MinutesWorked
Last edited by DataMiser; Apr 20th, 2017 at 03:25 PM.
-
Apr 20th, 2017, 03:28 PM
#3
Thread Starter
Enjoy the moment
Re: working hours problem
Code:
EnterID
EnterIN
EnterOut
EnterIN1
EnterOut2
EnterTotal
-
Apr 20th, 2017, 03:29 PM
#4
Thread Starter
Enjoy the moment
Re: working hours problem
At a glance it looks like it should work though I would probably not do it that way.
what way can you show me
-
Apr 20th, 2017, 03:39 PM
#5
Re: working hours problem
For the ones that fail, are any of the time entries NULL? If so, you'll probably have to make your SQL statement a bit more complex and test if those values for NULL.
-
Apr 20th, 2017, 03:56 PM
#6
Thread Starter
Enjoy the moment
Re: working hours problem
Originally Posted by LaVolpe
For the ones that fail, are any of the time entries NULL? If so, you'll probably have to make your SQL statement a bit more complex and test if those values for NULL.
is this code ok sir?
no null values
-
Apr 20th, 2017, 04:22 PM
#7
Re: working hours problem
What results are you actually getting?
Your description of the problem is not very clear.
-
Apr 20th, 2017, 04:32 PM
#8
Thread Starter
Enjoy the moment
Re: working hours problem
well sir i just found the problem with the ID in the DB
working to fix it
tnx for the help DM & LaVolpe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|