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 's%') AND (iberkshire.ss.date>='2011-08-01 00:00:00' AND iberkshire.ss.date<='201' at line 1