Hello,
The following code does not work. How do I create this query using ORM syntax ?
Currently, this query gives me the following error:
ERROR: (HY000) SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: 'DATE_SUB(NOW(),INTERVAL 11 YEAR))'
This is odd to me since the following code works directly in mysql
The following code does not work. How do I create this query using ORM syntax ?
PHP Code:
->where([
'evaluationDate>' => 'DATE_SUB(NOW(),INTERVAL 11 YEAR)',
])
ERROR: (HY000) SQLSTATE[HY000]: General error: 1525 Incorrect DATETIME value: 'DATE_SUB(NOW(),INTERVAL 11 YEAR))'
This is odd to me since the following code works directly in mysql
Code:
SELECT * FROM `equipment_performance_evaluation_report` WHERE `evaluation_date` > DATE_SUB(NOW(), INTERVAL 11 YEAR)
Comment