Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone! I have the following information:
EMPLOYEE | HireDate | TermDate |
850004 | 16/08/2010 | 02/02/2016 |
850004 | 13/02/2016 | - |
850243 | 30/05/2011 | 15/02/2016 |
850243 | 23/04/2016 | 24/05/2017 |
850325 | 27/06/2011 | 21/01/2012 |
850325 | 08/09/2012 | 26/02/2013 |
This is an example of a table where i have hiredate and termdate (employees appear twice because they left and then returned) (the one that has a null value is because he was hired then he left and now is back again)
I want to know who has been active for 90 days or less (for example) but that is not all, i want to know this info base on the day i'm watching (i have a variable that has the date the user wants to see, when the user need to see a different date, he changes it)
So, if the user is watching 24/11/2018 then there is not any employee that has been active for 90 days or less
But if i the user watchs 24/04/2016 then there are two employees that have been actives for 90 days, even though one employee already left, in that moment he was active (850243)
Any ideas?
Thanks!