Hi,
Can someone help me with this query. I try to select all product within last 24 months but I get some errors
SELECT ID
FROM Purchases
WHERE PERIOD_DIFF( DATE_FORMAT( (
NOW( ) , "%y%m" ) ) , DATE_FORMAT( (
PurchaseDate
), "%y%m" )
) =24
LIMIT 0 , 30
MySQL said: Documentation
#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 '), DATE_FORMAT((PurchaseDate),"%y%m")) = 24 LIMIT 0, 30' at line