Been trying to get this simple query to work all morning... plenty of search results for RawValue with insterts, but nothing for the WHERE clause?
$users = User::find([ 'year(cdate) = ' . new RawValue('year(CURRENT_TIMESTAMP)') ]);
Column 'CURRENT_TIMESTAMP' doesn't belong to any of the selected models
$users = User::find([ 'year(cdate) = year(CURRENT_TIMESTAMP)' ]);
Column 'CURRENT_TIMESTAMP' doesn't belong to any of the selected models
$users = User::find([ 'conditions' => 'year(cdate) = ?1', 'bind' => [ '1' => new RawValue('year(CURRENT_TIMESTAMP)') ] ]);
Yields zero results, there should be 3.
$users = User::find([ 'conditions' => 'year(cdate) = ?1', 'bind' => [ '1' => '2017' ] ]);
Yields 3 results, as expected.
What do I have to do to bind year(CURRENT_TIMESTAMP)?????
THANKS! Adam