Issue
I need to change the below MySQL code to laravel format using where, between and like operators together:
select count(id) from tbl1
where created_at BETWEEN
'2018-12-10%' AND '2018-12-12%'
Solution
I found the answer as below:
\DB::table('tbl1')->whereBetween('created_at',[$sdate.'%', $enddate.'%'])->count();
Answered By - Zaker Husien
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.