0

I'm trying to select people hired in May but my (MONTH(HIRE_DATE) = 05) doesn't work

SELECT EMPLOYEE_ID AS "Employee Number", LAST_NAME ||', '|| FIRST_NAME AS 
"Full Name", JOB_ID, '[' || TO_CHAR(HIRE_DATE, 'Month fmddth "of" YYYY') ||']' AS "Hire Date"
FROM EMPLOYEES
WHERE (HIRE_DATE NOT BETWEEN TO_DATE('01/01/1994','DD/MM/YYYY') AND 
TO_DATE('31/12/1995','DD/MM/YYYY')) AND
(MONTH(HIRE_DATE) = 05)
user7218356
  • 5
  • 1
  • 2
  • 4
    Where in the [Oracle manual](https://docs.oracle.com/database/121/SQLRF/toc.htm) did you find `month()` –  Jun 19 '17 at 15:59
  • Possible duplicate of [how to convert date into month number?](https://stackoverflow.com/questions/14041200/how-to-convert-date-into-month-number) – Gonzalo.- Jun 19 '17 at 16:00

1 Answers1

3

There is no MONTH() function in Oracle.

Both to_char(hire_date, 'mm') = '05' and extract (month from hiredate) = 5 should work.