I am trying to make an SQL query where I can check if DateTimestamp contains this month and year.
Part of the request:
$leads = DB::table('leads') ->leftJoin('invoices', function($join2) { $join2->on('leads.id', '=', 'invoices.lead_id'); }) ->where('invoices.chance', '!=', 0) ->where('invoices.updated_at', '=', date('m-Y'))
I tried this with date_parse, the new DateTime (), but that didn't work. What am I doing wrong?
Js-nl source share