Hi Guys I Have not been able to solve this problem from quiete a while now. I am using sql server 2005. I have got a table which contains these columns - start date, end date and volumes if the month in the start date is same as that of end date, the volume remains same, else if the months in the two dates are different, then i have to distribute the volume in such a way that some part will go in the first month and the rest in the other month.. i have to somehow calculate (or prorate) the volume according to the no of days in each month I have to perform a query on this table so that I can group the volumes for months and years. Here is the sample data... Service Start Service End FMIS Code No of Units Year Month Volumes 01-Oct-00 15-Aug-01 6440 32 ? ? ? 01-Oct-00 30-Sep-02 6441 40 ? ? ? 01-Oct-02 22-May-03 6440 78 ? ? ? 01-Oct-02 23-May-03 6990 87 ? ? ? 06-Mar-03 31-Jul-03 6997 102 ? ? ? 07-Mar-03 31-Jul-03 6744 3 ? ? ? 01-May-03 31-May-03 6440 789 ? ? ? 23-Jun-03 31-Aug-03 6447 1000 ? ? ? 29-Jun-03 30-Jun-03 6440 981 ? ? ?