I have table called leave transaction
Given parameters :
EmpID = 431, LeaveFromDate=01-01-2014, LeaveTodate=31-01-2014
EmpId LeaveFromDate LeaveTODate NoOfDays
--------------------------------------------------------------------------------
431 02-01-2014 04-01-2014 2
431 12-01-2014 18-01-2014 6
431 27-01-2014 07-02-2014 12
---------------------------------------------------------------------------------
Note :Underlined leavetodate is out of range to make that similar to the given Leavetodate
What I want to do is:
EmpId LeaveFromDate LeaveTODate NoOfDays
--------------------------------------------------------------------------------
431 02-01-2014 04-01-2014 2
431 12-01-2014 18-01-2014 6
431 27-01-2014 31-01-2014 5
---------------------------------------------------------------------------------
Thanks in advance