J
James Goodman
I have modified the ASP.NET TimeTracker Starter Kit to include the ability
for users to log working hours (Start Time, Finish Time, Lunch Duration).
This is then presented to them in a grid & a TimeWorked column is calculated
(in a UDF within the DB).
I want to include a label in the footer of TimeWorked which will show the
TotalTimeWorked in the format HH:mm (e.g. 37:30).
All of these TimeWorked values are returned in the format #1/1/1900
7:30:00AM# which indicates a total of 07:30 for the day. This is formatted
in the grid & displays as desired.
I notice that you can subtract one datetime from another, but you can only
add a timespan a datetime. I therefore created a timespan by subtracting
#1/1/1900 00:00:00# from the TimeWorked value. I then added this timespan to
a Total timespan. Unfortunately, this does not appear to calculate correctly
with example values:
TimeWorked
07:50
11:25
08:00
07:50
05:40
As I loop through these the values in tsTotal are:
tsTotal.Hours:tsTotal.Minutes
7:50
19:15
3:15 (Starts going wrong here?)
11:5
16:45
How can I add these values to get the Sum(TimeWorked)?
for users to log working hours (Start Time, Finish Time, Lunch Duration).
This is then presented to them in a grid & a TimeWorked column is calculated
(in a UDF within the DB).
I want to include a label in the footer of TimeWorked which will show the
TotalTimeWorked in the format HH:mm (e.g. 37:30).
All of these TimeWorked values are returned in the format #1/1/1900
7:30:00AM# which indicates a total of 07:30 for the day. This is formatted
in the grid & displays as desired.
I notice that you can subtract one datetime from another, but you can only
add a timespan a datetime. I therefore created a timespan by subtracting
#1/1/1900 00:00:00# from the TimeWorked value. I then added this timespan to
a Total timespan. Unfortunately, this does not appear to calculate correctly
with example values:
TimeWorked
07:50
11:25
08:00
07:50
05:40
As I loop through these the values in tsTotal are:
tsTotal.Hours:tsTotal.Minutes
7:50
19:15
3:15 (Starts going wrong here?)
11:5
16:45
How can I add these values to get the Sum(TimeWorked)?