I'm trying to get the patient back to me for a certain day and time in the following command:
SqlCommand cmdSelect = new SqlCommand("select DISTINCT P.nome,P.codPaciente,
M.codMedico, C.descricao from Consulta as C " +
", Medico as M, Paciente as P where M.codMedico = C.codMedico and " +
"P.codPaciente = C.codPaciente and M.cpf = @cpf and " +
"cast(C.dataConsulta as date) = @data",conexao);
cmdSelect.Parameters.AddWithValue("@cpf", Session["cpf"]);
cmdSelect.Parameters.AddWithValue("@data", data);
But you are returning all patients for the day.
I tried to change as date
to as datetime
, when I do this it returns null
, I tried to convert datetime
to date and pass straight but it will not.
The date is being passed this way: 2018-11-10 17:35
.
I changed it to be 2018-11-10 17:35:00.000
, but it still was not.
What should I do?