0

Whats wrong with this query?

TIME_FORMAT(
			DATE_ADD
				(
					TIMEDIFF(TIMEDIFF(u.hour_end, u.hour_begin),(u.hour_pauze)),
					TIMEDIFF(TIMEDIFF(u.hour_end_o, u.hour_begin_o),(u.hour_pauze_o))
				)
			,'%H:%i') AS total,

I get the error:

#1305 - FUNCTION system.DATE_ADD does not exist

BTW: I am using version 5.0.51a.

2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by kvdd
0

When I try that, I get the same error, but without the '_'.

Can it be that my query is wrong?

Edit: I have checked and double checked that part of the query, but I do not find a wrong statement in it.

Could you check my query?

0

You should never believe me, but I have used spaces in my query between the function name and the parenthesis (and then mysql says: function does not exist, because that extra space ' ' after the function(!)).

But my query does not again not work.

SELECT 
	
	TIME_FORMAT(
		DATE_ADD(
			TIMEDIFF(TIMEDIFF(u.hour_end, u.hour_begin),(u.hour_pause)),
			TIMEDIFF(TIMEDIFF(u.hour_end_o, u.hour_begin_o),(u.hour_pause_o))
				),'%H:%i'
				) AS total
FROM 
	hour AS u 
	
WHERE 
	DATE_FORMAT(u.hour_begin, '%H:%i') != '00:00'

Now it says, that I should have a syntax error, at line 6.

If you have some knowledge, can someone check that line?

Edit: I try to use ADDTIME and ADDDATE and so on, but no result yielded.

Edit2: I use now ADDTIME, and it seems working.

Thanks.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.