Waheed2008
Registered User.
- Local time
- Today, 13:39
- Joined
- Jul 17, 2008
- Messages
- 57
Hi,
I am working on the time attendance system for employees of a company and stuck into time calculations. The situation is that in a company there are three shifts:
1. 0700 hr to 1500 hr (NS-Normal Shift)
2. 1500 hr to 2100 hr (OT1-Overtime Shift 1)
3. 2100 hr to 0700 hr next day (OT2-Overtime Shift 2)
A table is keeping a record of IN & OUT movement of employees. E.g.
Table-1
ID = 114578
Date = Aug 5, 2012
Name = Kamran Khan
IN = 0900
OUT = 2200
If an employee Sign IN at 0900 hr and Sign OUT at 2200 hr, which will be one record in a table as shown above, how can I separate the time spent into the above three categories. I want to design a query where I can get NS, OT1 & OT2 from the record and show result similar like this:
ID = 114578
Date = Aug 5, 2012
Name = Kamran Khan
IN = 0900
OUT = 2200
Duration = 1300
NS = 0600
OT1 = 0600
OT2 = 0100
How can I design such a query. Please help me in this issue. I am trying for last couple of days but could not find any way of calculation.
Many many thanks in advance.
Regards
Abdul Waheed
I am working on the time attendance system for employees of a company and stuck into time calculations. The situation is that in a company there are three shifts:
1. 0700 hr to 1500 hr (NS-Normal Shift)
2. 1500 hr to 2100 hr (OT1-Overtime Shift 1)
3. 2100 hr to 0700 hr next day (OT2-Overtime Shift 2)
A table is keeping a record of IN & OUT movement of employees. E.g.
Table-1
ID = 114578
Date = Aug 5, 2012
Name = Kamran Khan
IN = 0900
OUT = 2200
If an employee Sign IN at 0900 hr and Sign OUT at 2200 hr, which will be one record in a table as shown above, how can I separate the time spent into the above three categories. I want to design a query where I can get NS, OT1 & OT2 from the record and show result similar like this:
ID = 114578
Date = Aug 5, 2012
Name = Kamran Khan
IN = 0900
OUT = 2200
Duration = 1300
NS = 0600
OT1 = 0600
OT2 = 0100
How can I design such a query. Please help me in this issue. I am trying for last couple of days but could not find any way of calculation.
Many many thanks in advance.
Regards
Abdul Waheed
Last edited: