Hiral Posted February 21, 2019 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. Link to comment Share on other sites More sharing options...
Hiral Posted March 18, 2019 Author Share Posted March 18, 2019 Please help anyone. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 18, 2019 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. Link to comment Share on other sites More sharing options...
Hansiebebe Posted March 25, 2019 Share Posted March 25, 2019 SELECT MIN([DATE]) AS DATE,[NAME] FROM EMPLOYEES GROUP BY [NAME] This is what you're looking for ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now