I have a small problem, maybe it's the simplest I have a query which shows me date and time that is already stored in BD, but always shows me the same time in all 2018-10-05 12: 46: 03,000 the time if the query is saved well is as follows:
protected function obtenerNotas(Request $request){
return response()->json(
DB::table('tblNotas as n')
->select('n.idNota','n.Observacion as Nota','n.claveAccion as ClaveAccion','uu.Nombre as Verificador','u.Nombre as Usuario',
DB::raw("(CONCAT(DAY(Fecha),'/',MONTH(Fecha),'/',YEAR(Fecha),' ',SUBSTRING('2018-10-05 12:46:03.000',CHARINDEX(' ','2018-10-05 12:46:03.000'),9))) AS Fecha"))
->join('tblApoyoAcciones as aa','aa.ClaveAccionApoyo','n.claveAccion')
->join('tblUsuarios as u','u.idUser','n.idUsuario')
->join('tblUsuarios as uu','uu.idUser','n.idUsuario')
->where('aa.ClaveAccionApoyo',$request->claveAccion)
->orderBy('Fecha','DESC')
->get()
);
}
Result:
11/30/2018 12:46:03
11/20/2018 12:46:03
11/10/2018 12:46:03
I hope you can help me :( I would appreciate it.