I am in need of some assistance in getting 2 datetimes to split into the hour intervals between them.
This is working with ‘pay’ data, so it needs to be very accurate. I need to take clockin and clockout, and split them into hour intervals.
Example:
clockin = 5/25/2011 1:40:56PM
clockout = 5/25/2011 6:22:12PM
I need that to look like:
5/25/2011 1:40:56PM
5/25/2011 2:00:00PM
5/25/2011 3:00:00PM
5/25/2011 4:00:00PM
5/25/2011 5:00:00PM
5/25/2011 6:00:00PM
5/25/2011 6:22:12PM
I then plan to check those times against a ‘differential’ table to see fi they should have a new paycode. But I’ll worry about the paycode later.
Any help splitting out the times? Prefer C#, but I also have access to MSSQL2000 (which is where we pull the original times)
1 Answer