I need some help! Trying to recreate the following query in Wappler that works fine in SQL. I have been trying to get this to work for three days so any assistance greatly appreciated.
SELECT * FROM visits WHERE dateArr > DATE_FORMAT(NOW() ,’%Y-08-01’)
You are doing 2 different things, formatDate and DATE_FORMAT are not the same functions.
DATE_FORMAT is a function from MySQL and is run on the database, the NOW() returns the datetime in the timezone set in MySQL.
formatDate is a formatter and runs in PHP, the NOW variable is the server time in the timezone set in PHP.
But NOW and NOW() can return different times depending on the configuration. The correct format for the formatDate formatter is actually NOW.formatDate('yyyy-08-01'), but on PHP Y would also work.