mercredi 17 mars 2021

Fetch row betwwen two dates laravel

I have submitted_date column in my database where date is stored like this it is of varchar type

07/10/2020

now i'm retrieving rows using this query if certain row exists between the given dates

 $start_date = \Carbon\Carbon::parse($request->start_date)->format('d/m/Y');
 $end_date=\Carbon\Carbon::parse($request->end_date)->format('d/m/Y');
 $Data = Pos::where('submitted_date', '>=', $start_date)->where('submitted_date', '<=', $end_date)->get();

this query does not return proper result.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire