In my query below for terminated employees, I need the datepart function to return terminated employees up to the date entered but only from the year of the date entered.
So if a user enters the date 2/1/04 they should see all employees that have terminated in 2004, through Feb. 1st.
However, what is happening is that I am only seeing employees terminated AFTER or EQUAL to the date specified.
Here is that part of the query:
Eemploy.Eestatus = 'Terminated' AND Eemploy.Eedateend IS NULL AND Ejob.EjDateEnd = Eemploy.Eetermdate and eemploy.eetermdate IN(DATEPART(YEAR, GetDate()))
Any ideas?
So if a user enters the date 2/1/04 they should see all employees that have terminated in 2004, through Feb. 1st.
However, what is happening is that I am only seeing employees terminated AFTER or EQUAL to the date specified.
Here is that part of the query:
Eemploy.Eestatus = 'Terminated' AND Eemploy.Eedateend IS NULL AND Ejob.EjDateEnd = Eemploy.Eetermdate and eemploy.eetermdate IN(DATEPART(YEAR, GetDate()))
Any ideas?