Using SQL Server 2000
I want to save the details in month wise
User Entry
ID = 001
Fromdate = 01/01/2012
Todate = 29/03/2012
ID = 002
Fromdate = 01/05/2012
Todate = 19/06/2012
ID = 003
Fromdate = 01/04/2012
Todate = 30/04/2012
.....
From the user entry, i want to insert the details in to table1 with the condition like fromdate and todate split in to monthwise (mm/yyyy)
Expected Output
ID period fromdate todate
001 01/2012 01/01/2012 31/01/2012
001 02/2012 01/02/2012 29/02/2012
001 03/2012 01/03/2012 29/03/2012
002 05/2012 01/05/2012 31/05/2012
002 05/2012 01/06/2012 19/06/2012
003 04/2012 01/04/2012 30/04/2012
....
....
fromdate, todate fomat is dd/mm/yyyy
period format is mm/yyyy
How to do this in sql server.
Need sql Query Help