3
I need to make a select that brings me occurrences that the initial date of a leave is less than 3 years from the date of an employee’s admission
Follow below excerpt from my code.
SELECT *
FROM
jmh_licenca l
INNER JOIN
jmh_servidor s on l.lic_ser_id = s.ser_id
INNER JOIN
jmh_doenca d ON l.doe_id = d.doe_id
WHERE
l.lic_data_inicial BETWEEN '2012-08-01' AND '2015-08-01' AND
l.lic_data_inicial **< (3anos)** s.ser_data_admissao AND
tip_lic_id in ('9', '12');
AND year(l.lic_initialdata_) < 3 year must relate to the date of admission of each official.
– Emerson Simões Mateus
See this link ... Here
– Marco Souza