Reputation: 199
In my query, i am trying to compare today's date only (without time) to my field created_at
but i get the error below
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2018-08-29 DATE(created_at)' at line 1
Controller
$item_shipped = Item::where('id',Auth::user()->id)->whereRaw('DATE(created_at)' , '=', Carbon::now()->toDateString())->get();
return $item_shipped;
How do i solve this problem ?
Upvotes: 0
Views: 415