aspose file tools*
The moose likes Java in General and the fly likes Total Time duration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Total Time duration" Watch "Total Time duration" New topic
Author

Total Time duration

sundar sankaran
Greenhorn

Joined: Aug 10, 2004
Posts: 10
Hi ALL,
I need to get total time duration of my user in my application. I got maximum time duration he has spent for a month from the below sample query .




The output I got as below:
siteDuration---------------->::00:00:24
siteDuration---------------->::00:00:05
siteDuration---------------->::00:00:09
siteDuration---------------->::00:00:14
siteDuration---------------->::00:51:33
siteDuration---------------->::00:16:42
siteDuration---------------->::00:00:05
siteDuration---------------->::00:00:25
siteDuration---------------->::00:00:05
siteDuration---------------->::00:00:10
siteDuration---------------->::00:00:09
siteDuration---------------->::00:03:02
siteDuration---------------->::00:00:18
siteDuration---------------->::00:00:11

I need to total all the times mentioned above and get the result as total duration time. How it is possible in java?
I have tried with Sum function in SQl, but it will not total the time(HH:MM:SS), it can total only the integer values. The resultset i am getting is set of all the max time duration the user has spent for a month, so i need to total all the values and get the output as single Time in HH:MM:SS format.
Help in java code is appreciated.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Simplifying your statement (removing needless intermediate StringBuffer):



I'm asking, how this query might return multiple rows?
You don't have a GROUP clause, so SELECT MAX (x) FROM (y) should return just one value - the maximum.

Probably you're hiding something here?

and you tried

without success?


http://home.arcor.de/hirnstrom/bewerbung
sundar sankaran
Greenhorn

Joined: Aug 10, 2004
Posts: 10
I thought the fully query is not important. The resultset i am getting is set of all the max time duration the user has spent for a month, so i need to total all the values and get the output as single Time in HH:MM:SS format. Hope this clarifies your doubts. This is my query:
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Total Time duration