Using Sql Server 2000
Table1
id sdate edate
001 05/01/2012 25/02/2012
002 19/02/2012 17/04/2012
.....
sDate, eDate format is dd/mm/yyyy
I want to get firstdate and lastdate of eachmonth from the table1 like 01/01/2012 31/01/2012
, 01/02/2012 29/02/2012
Expected Output
id sdate edate
001 05/01/2012 31/01/2012
001 01/02/2012 25/02/2012
002 19/02/2012 29/02/2012
002 01/03/2012 31/03/2012
002 01/04/2012 17/04/2012
.....
How to make a query for the above condition?
Need Query help