• Have a look at this thread from the MSDN forums, where I answer a similar question. Hopefully it should get you started.

    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/36b98d06-fe73-4849-ba68-c8a2110afba0/how-can-i-divide-transaction-on-fifo-basis

    If that does help you, please post your table definition and sample data in SQL format, that is, as CREATE TABLE and INSERT statements. And please specify which version of SQL Server you are using.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]