newphpcoder Posted April 24, 2012 Share Posted April 24, 2012 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 More sharing options...
CCZ Posted April 25, 2012 Share Posted April 25, 2012 (edited) 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 April 25, 2012 by CCZ Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now