Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hallo everyone,
i have trouble during convert integer become time in mysql.
1.i have 2 rows of data in time format.
row A=01:00:00
row B=01:30:00
after that i convert this two data become integer data type and i add row A and B data.
after i get the result from this two row where the result is 150. i try to convert it back become time data type, but i m stuck in this part. any suggestion from senior are appreciate
thank you very much

anywhere this is my sql Query

SQL
SELECT SUM((MID(Total,1,2) * 60) + MID(Total,4,2)) AS Extra_OT FROM extra_overtime WHERE Emp_ID='001EJ011' AND DATE(AttDate)='2013-10-03' GROUP BY Emp_ID, AttDate;
Posted
Updated 10-Dec-13 13:53pm
v4

1 solution

Why can't you use the ADDTIME function?

SQL
SELECT ADDTIME('01:00:00','01:30:00') AS Extra_OT
 
Share this answer
 
v2
Comments
JOE Heart Under Blade 10-Dec-13 19:56pm    
sorry sir.. i got what do u mean... actually i want to add data of 2 rows, not column. sorry my mistake. is this condition can use in my case?
Ganesh Raja 10-Dec-13 22:39pm    
Can you add some sample data?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900