Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jaseofspades88's avatar

'But that issue still remains as well' - I have used Tinkerwell and tested the proposed solution above for filtering by date. Did this snippet not solve that problem?

return DB::table('appcal')
    ->select('monthyear','appdate')
    ->whereDate('appdate', '>=', Carbon::createFromFormat('Y-m-d', '2018-04-01'))
    ->get();
ramniksingh's avatar

@lancashireman Thanks . Your snippet is right when we have a different datatype/format stored.

Actually the issue was of using query inside a loop which sometimes run and sometimes not. May be because of size of result set. That confused for this wheredate issue.

Previous

Please or to participate in this conversation.