I am making a screen in php where the user has the date filter to extract a report from SQL Server , but MySQL it displays the default date mm / dd / yyyy , and I need it to dd / mm / yyyy in between
, does anyone know how to do this conversion?
Here is how I tried it:
SELECT p.idProcesso, p.Usr_id, p.Usr_name
, p.Usr_CPF, p.crd_snr, t.dsPunicao
, convert(varchar, p.dtCadastro, 103)+' '+convert(varchar, p.dtCadastro, 108) dtCadastro
, s.dsStatusProcesso
, p.idStatusProcesso
FROM tmProcesso AS p
INNER JOIN tcStatusProcesso as s
on p.idStatusProcesso = s.idStatusProcesso
INNER JOIN tcPunicao as t
on p.idPunicao = t.idPunicao
WHERE p.app_id = '$var_appid'
and p.dtCadastro between CONVERT(VARCHAR, '$var_dtini', GETDATE(), 103)
and CONVERT(VARCHAR, '$var_dtfim', GETDATE(), 103)"
I do not know if this is right, I would like to confirm, if it is very obvious, please forgive me.