Hiral 0 Posted February 21, 2019 Report Share Posted February 21, 2019 Hello Everyone, I am writing a query in SQL to pull the first date an employee became a teacher with no break in service. using the job table here to find effective date when a employee became teacher like example. 1. Teacher - 1/1/18. 2. coordinator- 2/1/18 3. Teacher- 3/1/18 Here in result I need the last entry as there is no gap in that title now. Quote Link to post Share on other sites
Hiral 0 Posted March 18, 2019 Author Report Share Posted March 18, 2019 Please help anyone. Quote Link to post Share on other sites
justsomeguy 1,135 Posted March 18, 2019 Report Share Posted March 18, 2019 I don't think you can do that with a basic query, maybe a stored procedure would work or else you would need to get all of the results and use another language to go through the data. Quote Link to post Share on other sites
Hansiebebe 0 Posted March 25, 2019 Report Share Posted March 25, 2019 SELECT MIN([DATE]) AS DATE,[NAME] FROM EMPLOYEES GROUP BY [NAME] This is what you're looking for ? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.