Jump to content

problem in SUm of time but not count the seconds


newphpcoder
 Share

Recommended Posts

Hi..I notice that I got problem in my code:

SELECT sec_to_time(SUM(time_to_sec(Rendered))) FROM reg_att WHERE EMP_NO = '09300139';

in this query the output is : 103:52:27 // total hours.but it's wrong it should only be 103:51 //if did not count the seconds.Now my question is what would be the syntax to correct the result.this is the sample data:08:00:0008:00:0008:00:0008:00:0008:00:0008:00:0008:00:0008:00:0008:00:0008:00:0008:00:0007:56:4207:55:45Thank you so much.

Link to comment
Share on other sites

Try concat(left(Rendered,6),'00') instead of Rendered:

SELECT sec_to_time(SUM(time_to_sec(concat(left(Rendered,6),'00')))) FROM reg_att WHERE EMP_NO = '09300139';

Since, or so it seems, you want to ignore the seconds.

Edited by CCZ
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...