Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I am using Employee database,it contains 10 years of data(2006-2016) .
My Scenario - I need to extract only 3 years of data (2014-2016),and i have to consider active employees those whoever joined on 2006 as well.
I have written the below Script for restriction:
((EFFECTIVE_TO_DATE=today() or DATE_OF_JOIN>=MAKEDATE(2014,01,01)) or DATE_OF_RESIGNATION>=MAKEDATE(2014,01,01))
Please find the attached sample data.
Any suggestions would be greatly appreciated.
Thanks & Regards,
P.Divya
Hi Divya,
May be you can try this way
Select *
From EmpTable
Where
DATE_OF_JOIN>=MAKEDATE(2014,01,01) and DATE_OF_RESIGNATION>=MAKEDATE(2014,01,01)
or
DATE_OF_JOIN>=MAKEDATE(2006,01,01) and DATE_OF_RESIGNATION>=Today()
;
Hope this helps.
Thanks
Karthik
What do you mean by active ?
1. They are still effective
2. They have not resigned.
Can you post your expected output based on the sample data which you provided ?