Question

I have a database that time stamps every five minutes, or less if the user stops the database. How can I take the sum of the difference between the time stamps and add them up?

EDIT

I have six different times all five minutes apart and one time the is, lets say, only 2 minutes from the last logged auto time that have been logged by the user:

13:41:33

13:46:33

13:51:33

13:56:33

14:01:33

14:06:33

14:08:27

now I want to take the times and add a mark that says its how many minutes from the last logged time:

13:41:33 = 0 //will be zero cause that is where the user started timing

13:46:33 = 5

13:51:33 = 5

13:56:33 = 5

14:01:33 = 5

14:06:33 = 5

14:08:27 = 2

After that I want my application to take all the fives and the twos and add them up:

0 +

5 +

5 +

5 +

5 +

5 +

2 =

27 minutes

Was it helpful?

Solution

Use a SQL SUM function on that column and it should give you your result. You should probably tag your question with more specific tags (SQLite, SQL, Etc)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top