Convert MySQL query to SQL Server query in Laravel

Viewed 27

I have this MySQL query:

$providerChart_data = Provider::select(\DB::raw("COUNT(*) as count"), \DB::raw("MONTHNAME(created_at) as monthname"), \DB::raw("max(created_at) as created_At"))
                            ->groupBy('monthname')
                            ->orderBy('created_At')
                            ->get();

since we need to move to SQL Server the code is not working, I'm having issue in the month name.

enter image description here

Thanks.

0 Answers
Related