SOLVED

SQL Server syntax

Copper Contributor

Hello Friends

 

I have a query like below which is in Oracle syntax.  How do I write this for SQL server?

Your help is highly appreciated.

 

  1. Display the first name and join date of the employees who joined between 2002 and 2005.

SELECT FIRST_NAME, HIRE_DATE FROM EMPLOYEES WHERE TO_CHAR(HIRE_DATE, 'YYYY') BETWEEN 2002 AND 2005 ORDER BY HIRE_DATE

2 Replies

Hi @Sqller -- Something like this would probably work.  Take care.

SELECT
	FIRST_NAME,
	HIRE_DATE
FROM
	EMPLOYEES
WHERE
	YEAR(HIRE_DATE) BETWEEN 2002 AND 2005
best response confirmed by Sqller (Copper Contributor)
Solution
super, it works. Thanks a lot. Appreciate your help.
1 best response

Accepted Solutions
best response confirmed by Sqller (Copper Contributor)
Solution
super, it works. Thanks a lot. Appreciate your help.

View solution in original post