Select the dates below a certain year

0

How can I create select to show only the employees of a company that have been admitted to it before a given year?

The type yearAdmission is date ie: dd-mm-AA

    
asked by anonymous 07.02.2018 / 20:31

3 answers

2
SELECT * FROM Tfuncionario where EXTRACT (YEAR FROM anoAdmissao) < '2000'

The extract function was used to select only the year from the yearAdmission field, and then compare it to the desired year.

    
13.02.2018 / 14:12
1

Simple like this:

select * from tfuncionario where anoAdmissao < to_char('2000/01/01', 'yyyy/mm/dd');

using to_char to format a mask.

where '2000/01/01' matches the given question period

    
07.02.2018 / 20:35
0

I got it with this snippet of code:

select * 
from tfuncionario F 
where F.ANOADMISSAO <= ('01/01/00');
    
07.02.2018 / 20:46