mercredi 23 mars 2016

How to select where date without times from mysql in laravel?

I want to select by whee in Laravel which data contain by datetime (2016-03-30 00:00:00) but I want only date not times.

 $tran = TillTransaction::where(DB::raw('DATE(open_time)'),'=','2016-03-24')->get();
    if($tran){
        $retn = ['res'=>true,'permis'=>true,'data'=>$tran];
    }

Errors

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'open_time' in 'where clause' (SQL: select * from `tb_till_transaction` where DATE(open_time) = 2016-03-24)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire