I have no idea how to set specified date format to query with CASE WHEN. What i try to do is to create a select that will look like one bellow.
$qb -> select('
CASE WHEN ps.paymentDate >= (new \DateTime(\'%Y-%m-01\')) THEN \'true\' ELSE \'false\' END as myVar
');
I looked for the solution in the internet but i haven't found it. Am i thinking about the whole problem right?
Previous code in mysql looked like this:
IF(ps.payment_date >= DATE_FORMAT(CURDATE(),\'%Y-%m-1\'),\'true\',\'false\') as myVar