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 '´2000-01-01´ and ´2000-02-01´' at line 1
Query:
SELECT AVG(stand) as avg_jan FROM standen WHERE tijd between ´2000-01-01´ and ´2000-02-01´
Als ik alle quotes weglaat dan krijg ik hetzelfde resultaat als in het begin :'(
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 '00:00:00 and 2000-02-01 00:00:00' at line 1
SELECT AVG(stand) as avg_jan FROM standen WHERE tijd between 2000-01-01 00:00:00 and 2000-02-01 00:00:00
Ik gebruik zelf dit stukje code in een van mijn scripts
SELECT * FROM $table WHERE datum BETWEEN $mavan AND $matot;
en dat werkt prima zonder de ''
Probeer het nog eens zonder de tijd( dus alleen YYYY-MM-DD) als je wilt en in wat voor VELD is je data in de tabel opgeslagen?