2
Guys, I have a problem extracting dates on a range of trainings. What I need is the following if a training had its beginning on 01/01/2017 and its completion on 03/03/2017 raise should return in the select below for the months 01,02 and 03. Today this select only returns me the trainings that were created within a month.
SELECT distinct *
FROM treinamentos,usuario_x_treinamento,usuario
WHERE status_treinamento = 'REALIZADO'
AND treinamentos.data_inicio_treinamento >='2017/01/1'
AND treinamentos.data_inicio_treinamento <='2017/01/31'
AND usuario_x_treinamento.id_usuario = usuario.id_usuario
AND usuario_x_treinamento.id_treinamento = treinamentos.id_treinamentos;
But since I’m only using the range at the start date I can’t make the selection I need.
PS : Select runs for all months of the year (it is used to generate a report).
What I need is to maintain the range Month by Month but also take into account the trainings that extend for more than a month.
Is the end date of the training registered in the bank? Is there an amount of days/months fixed? Is there where to get the duration of the training? Otherwise there is no way to resolve this issue.
– mau humor