Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have dates and I want to exclude Periods of dates.
Let's say I have Table LeaveMaster
ID LeaveDate
1 23/09/2015
1 24/09/2015
1 25/09/2015
1 27/09/2015
1 29/09/2015
1 30/09/2015
1 01/10/2015
1 02/10/2015
1 04/10/2015
So , the Result should be
ID StartDate EndDate
1 23/09/2015 25/09/2015
1 27/09/2015 27/09/2015
1 29/09/2015 30/09/2015
1 01/10/2015 02/10/2015
1 04/10/2015 04/10/2015
How to solve this ?. Need help.
Posted
Updated 17-Nov-15 20:48pm
Comments
Peter Leow 18-Nov-15 1:42am    
No can do. Not enough data in leavemaster table to achieve, e.g. start date, end date, or even duration of leave. In fact, your desired result should have been the leavemaster table.
kiran kumar 18-Nov-15 5:34am    
Thanks Peter, It is possible. i got solution.
Suvendu Shekhar Giri 23-Nov-15 14:59pm    
If you got the solution, share here so that others can take the reference and the question can be marked as solved.
kiran kumar 23-Nov-15 23:52pm    
http://stackoverflow.com/questions/33773811/get-periods-of-dates-from-sql-query/33775600#33775600

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900