The picture below is my sample database and I want to query record which do not have the same date_received as date_released and time_received as time_released.
The following MySQL query works exactly what I want:
SELECT * FROM `dts_track` where date_received != date_released and time_received != time_released
This is my Yii2 active record query so far, but it returns all records from the database:
$unit_received = \common\models\dts\DtsTrack::find()->where(['!=', 'dts_track.date_received', 'dts_track.date_released'])->andWhere(['!=', 'dts_track.time_received', 'dts_track.time_released']);
