Reputation: 11
I am try to add time by following code
SELECT ADDTIME('13:20:32.50','1:39:27.50', '13:20:32.50') as TotalTime;
But it shows error: #1582 - Incorrect parameter count in the call to native function 'ADDTIME'. What should I do? Is my code wrong?
Upvotes: 0
Views: 696
Reputation: 51
You can use ADDTIME()
function
SET @t1 = '12:00:00', @t2 = '15:30:00',@t3 = '15:30:00';
Set @t4= ADDTIME(@t1,@t2);
SELECT ADDTIME(@t4,@t3);
Upvotes: 3
Reputation: 13484
In you can use only two parameter in ADDTIME
ADDTIME() adds expr2 to expr1 and returns the result.
SELECT ADDTIME(expr1, expr2) as required_datetime;
Upvotes: 1