I am working producing some reports based on two files we get from warehouses we deal with. I have gotten some help already and it was much appreciated but I am still stuck on a few things.In my test database (SQL 2000) I have two tables, one that shows items received and one that shows items shipped. I want to look at the quantity and weight based on 15 day intervals from the date it arrived in the warehouse. And I need to multiply the weight by .5I am new at this still and I am lost on getting two different views of the data1st view is more detailed:ReportDate, Consignee, BOL, MARK, QTY, Weight, Weight*.52nd is more summarizedReportDate, Consignee, QTY, WeightI am then thinking I will export the results out and use a pivit table in excel or may do something in crystal.Here is sample date and below in the query…http://www.mojowares.com/testdata2.xls-- -------------------------------------------- append both input tables into a single table-- change quantity to negative for shipped items-- ------------------------------------------declare @Inventory table (CONSIGNEE nvarchar(255), BOL nvarchar(255), MARK nvarchar(255), Qty float (8), ReceivedWeight float (8), [Date] datetime)insert @Inventory (CONSIGNEE, BOL, MARK, QTY, ReceivedWeight, [Date])select CONSIGNEE, BOL, MARK, ReceivedQTY, ReceivedWeight, ReceivedDate from tblReceivedinsert @Inventory (BOL, MARK, Qty, [Date])select BOL, MARK, -1 * ShippedQTY, ShippedDate from tblShipped-- -------------------------------------------- initialize values-- ------------------------------------------declare @InitQty int, @InitDate datetimeselect @InitQty = 0 -- assumes initial quantity is zeroselect @InitDate = min([Date]) from @Inventory-- -------------------------------------------- creates table with numbers counting by 15-- alternatively you could have a fixed table-- in your database with same-- ------------------------------------------declare @Digits table (Num int)insert @Digitsselect 0union allselect 1union allselect 2union allselect 3union allselect 4union allselect 5union allselect 6union allselect 7union allselect 8union allselect 9declare @Days table (ReportDate datetime)insert @Daysselect dateadd(dd, (15 * (100*d3.Num + 10*d2.Num + 1*d1.Num)), @InitDate)from @Digits d1cross join @Digits d2cross join @Digits d3order by 1-- select * from @Days-- ------------------------------------------select r.ReportDate, i.BOL, i.MARK, @InitQty + sum(i.Qty) as Inventoryfrom @Days rleft outer join @Inventory ion r.ReportDate >= i.[Date]group by r.ReportDate, i.BOL, i.MARK