Ich habe bei einem SELECT-Query im ORDER BY-Teil ...
ORDER BY
CASE `oms_order`.`state`
WHEN 'UNTOUCHED' THEN
IF NOW > `oms_order`.`deadline` THEN -- line 24
0
ELSEIF DATE_ADD(NOW, INTERVAL 7 DAY) > `oms_order`.`deadline` THEN
2
ELSE
4
END
WHEN 'PROCESSING' THEN
IF NOW > `oms_order`.`deadline` THEN
1
ELSEIF DATE_ADD(NOW, INTERVAL 7 DAY) > `oms_order`.`deadline` THEN
3
ELSE
4
END
ELSE
5
END ASC,
`oms_order`.`deadline` ASC;
... bei dem über einen Syntaxfehler gemeckert wird ...
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOW >
oms_order.
deadline THEN 0 ELSEIF DATE_ADD(NOW, INTERVAL 7 DAY' at line 24' in ...
... verstehe aber nicht wirklich, was ich falsch mache.
Wo liegt mein Fehler?
MfG
bubble
--
If "god" had intended us to drink beer, he would have given us stomachs. - David Daye
If "god" had intended us to drink beer, he would have given us stomachs. - David Daye