Strange behaviouw when using onBeforeUpdate

I try to use this event to manipulate a field before it is written to the database. When doing so I got the error:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘00, archive = 1, order_date = ‘20-15-0603’, total_amount = 26.599,00, `date-crea’ at line 1
When you look in the mysql statement it appears as if the data has been shifted. Dates come in the form of
20-15-0603 etc.

The command I do is
if ( {status_id} == 1 && {payed} >= 0.20 * {total_amount}){
{status_id} = 2;
}
The status Id should be updated id a certain amount is payed

Hello,

Try to enable debug mode and give an echo in the field to check the returned value.

Date looks not correct builded. Are you using the right values, and/or using regional settings?