Click here to Skip to main content
15,902,275 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

Need to capture Login and logout time in vba excel form as per Business working hours.
That is if i am working in night shift,

Example : 25/01/2013 18:30 pm (login time in office - Shift Starts) 26/01/2013 03:30 am (logout time in office - Shift Ends)

So I need to capture the first login time , and the last logout time in the same day that is on 25/01/2013..even the Time capturing tool opened and closed several times....

Thanks for your help!
Posted

1 solution

Not sure what you are having problems with, or what the issue is but there are datetime functions you can use.

http://www.classanytime.com/mis333k/sjdatetime.html[^]
 
Share this answer
 
Comments
HNDP 13-Jun-13 18:53pm    
ok Let me give more clear on this. I have a macro which captures login logout time and other activities of the employee through the front end vba excel form and saves it to the backend access database.During the shift hours there is many chances that capturing tool may open and close several times. I have written coding as whenever the tool is opened it will capture as login time and when it closes , it captured as log out time.
But in this case , there are so many login & log out time's will be captured. in this i need to save only the first login time which captured first and the last logout time , when the time finally tool closed.I can able to handle this issue if it is normal daytime activity. But we have so many shifts in day as well as night. so after 12 pm excel consider as next day and creates a another login track in the data base, instead of that I need save it in the same day when the tool is opened.. So finally i need one login & logout time in a day(Business Hours) is it helpful ?
DinoRondelly 13-Jun-13 18:57pm    
So your problem is saving the log out time on the same day as the long in time?
HNDP 13-Jun-13 19:01pm    
yes almost, also not able to determine how to edit the user timings to update these login logout time. That is I am not sure on what basis I need to find the record and update with the recent one
DinoRondelly 13-Jun-13 19:07pm    
I have to be honest with you i am confused. This seems overly complicated to me, why not just have a clock in clock out button that the users press when they clock in or clock out

The best advice i would give you is to check your access table for the log in time when you log out and compare the dates and save the log out time.
HNDP 13-Jun-13 19:19pm    
yes the idea you given is working and I can able to handle this issue if one shift or only one day is available. But my problem is I have more than 4 shifts like 6.30 am to 3.30 pm, 9.00 am to 6.00 pm, 12.30 pm to 9.30 pm, 3.30 pm to 12.30 am 6.30 pm to 3.30 am & 9.30 pm to 6.30 am. I find issue only when two days involved in this like these shifts 3.30 pm to 12.30 am 6.30 pm to 3.30 am & 9.30 pm to 6.30 am.So here excel treat as next day after 12. So I cant able to update timings to exact date , ex if login time captured to 26/01/2013 but logout time captured in 27/01/2013 if it is night shift. anyway Thanks for your assistance...!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900