3
I have the following SQL
SELECT `age`.*, `inte`.`int_nome`, `inte`.`int_cod_unidade`, `set_uni`.`uni_titulo` as set_unidade, `set_cur`.`cur_titulo` as set_curso, `set_sta`.`set_setor` as set_status, `con`.`con_nome` as agendado_por, `ope`.`con_nome` as atendido_por
FROM (`agendamentos` as age)
JOIN `interessados` as inte ON `inte`.`int_cod`=`age`.`age_cod_interessado`
JOIN `unidades` as set_uni ON `set_uni`.`uni_cod`=`inte`.`int_cod_unidade`
JOIN `cursos` as set_cur ON `set_cur`.`cur_cod`=`inte`.`int_cod_curso`
JOIN `setores` as set_sta ON `set_sta`.`set_cod`=`age`.`age_status`
LEFT JOIN `consultoras` as con ON `con`.`con_cod`=`age`.`age_cod_consultora_agendado`
LEFT JOIN `consultoras` as ope ON `ope`.`con_cod`=`age`.`age_cod_consultora_atendido`
WHERE `age`.`age_data_agendado_para` BETWEEN CURRENT_DATE() AND CURRENT_DATE()+7
I need you to return records for the next seven days, but in my database I have the following records:
As I do to return correctly, in this example, I would have to return only two records that are within the criteria.
Same thing. :/
– Sr. André Baill