ich habe Versankosten “Spedition” angelegt welche greifen soll wenn das Gewicht 15kg übersteigt und die Länge > 1m ist und zu dem bestimmte PLZ-Gebiete beinhaltet. In den Bedingungen steht folgendes
gesamtgewicht >15 AND IFNULL(us.zipcode,ub.zipcode) LIKE '2%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '3%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '4%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '5%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '6%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '7%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '8%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '9%' AND laenge > 1000
Leider wird gesamtgewicht dabei immer ignoriert…
wenn ich nur die Bedinung
gesamtgewicht >15
stehen lasse funktioniert es. Kann mir jemand helfen?
das beschriebene Verhalten tritt wahrscheinlich auf, weil die Bedinungen nicht richtig verknüpft sind.
gesamtgewicht >15 AND (IFNULL(us.zipcode,ub.zipcode) LIKE '2%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '3%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '4%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '5%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '6%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '7%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '8%' OR IFNULL(us.zipcode,ub.zipcode) LIKE '9%') AND laenge > 1000
Die Abfrage der PLZ-Gebiete muss von einer Klammer umgeben sein, ansonsten bezieht sich die AND Bedingung nach gesamtgewicht >15 nur auf die nachfolgende Bedingung IFNULL(us.zipcode,ub.zipcode) LIKE ‚2%‘