7
I have the following research:
SELECT * FROM (`agendamentos`)
WHERE `age_data_agendado_para` BETWEEN "2016-08-28" and "2016-08-30"
In the database, I have:
But on my return, I can only search for two records, as the print_r():
Array - Campos de Pesquisa
(
[age_senha] =>
[age_nome] =>
[age_cod_consultora_atendido] =>
[age_cod_consultora_agendado] =>
[age_data_inicial] => 2016-08-28
[age_data_final] => 2016-08-30
[age_status] =>
)
Array - Resultados Print_r
(
[0] => stdClass Object
(
[age_cod] => 6
[age_cod_interessado] => 2
[age_data_agendamento] => 2016-08-18 09:00:12
[age_cod_consultora_agendado] => 1
[age_cod_consultora_atendido] => 1
[age_data_agendado_para] => 2016-08-29 08:00:00
[age_senha] => MA2745
[age_status] => 50
)
[1] => stdClass Object
(
[age_cod] => 7
[age_cod_interessado] => 2
[age_data_agendamento] => 2016-08-18 09:00:30
[age_cod_consultora_agendado] => 1
[age_cod_consultora_atendido] => 1
[age_data_agendado_para] => 2016-08-29 08:00:00
[age_senha] => MA2740
[age_status] => 50
)
)
Can anyone tell me why I can’t list all the items?
Puts
"2016-08-30 23:59:59.999999"
– Victor Stafusa
Well this, I put the schedules and it worked. But I also tried to use CAST, and it worked too.
– Sr. André Baill
Okay, that’s it. But those dates at your conclusion don’t make any sense, you used the
age_data_agendamento
while the consultation uses theage_data_agendado_para
.– Gustavo Cinque
I think
CAST
is a better idea. Because putting string to compare with date you let Mysql convert the way it wants.– Daniel Dutra
age_data_scheduling = Date the scheduling was launched on the system, and age_data_scheduled for is when it was scheduled.
– Sr. André Baill
Example: The consultant Marina, launched on 15/01/2015 a schedule for André to 20/01/2015. Endenteste?
– Sr. André Baill