I have table called tblleavetransaction
EmpID = 431, LeaveFromDate=01-01-2014, LeaveTodate=31-01-2014
EmpId LeaveFromDate LeaveTODate NoOfDays
--------------------------------------------------------------------------------
431 02-01-2013 04-01-2013 2
431 12-01-2013 18-01-2013 6
431 02-01-2014 04-01-2014 2
431 12-01-2014 18-01-2014 6
431 27-01-2014 07-02-2014 12
431 02-02-2014 04-02-2014 2
---------------------------------------------------------------------------------
Note: 5th entry should come in both months Jan as well as Feb (Need to Break somehow)
What I want to do is: While Passing
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 31-01-2014 4
---------------------------------------------------------------------------------
And While Passing
EmpID = 431, LeaveFromDate=01-02-2014, LeaveTodate=28-02-2014
EmpId LeaveFromDate LeaveTODate NoOfDays
--------------------------------------------------------------------------------
431 01-02-2014 07-02-2014 5
431 02-02-2014 04-02-2014 2
---------------------------------------------------------------------------------
Note : acually NoOfDays coloumn does'nt mater
Thanks in advance