Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sbhavan_s
Starting Member
2 Posts |
Posted - 2009-02-07 : 03:17:24
|
Following are the details of my ms access data fieldsdatabase name - daily empname – text starttime – date/time endtime – date/timeI would like to get the total elapsed time for all the employees using visual studio 2005 in gridview and tried with this query with sqldatasource, SELECT empname, format(SUM(endtime - starttime),'hh:nn:ss') AS totaltime FROM daily GROUP BY empnameAnd the result was,Empname totaltimeSara 04:49:06Raja 07:47:49Jaya 00:56:01Everything seems ok at first look. This is really what I wanted.But I wanted to double check the results with the data entered in to the access database. So I manually calculate the time for each employee. The results are correct for the first two employees (Sara and Raja). But for the “Jaya” my manual calculation was – 24:56:01My query result was – 00:56:01 I have lost 24 hrs.So, I tried to enter some raw data to the employees and checked the result. I noticed that when the time goes over the 24hr I get a 24 hr less result. I intend to calculate the total time for each employee in a weekly basis which approximately would be more than 60 hrs. I need to get all the results in hh:mm:ss format. Example: 60:25:42 I believe this is possible with some slight changes in the above select query, but how? Thanks in advance. |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|