The data input consists mainly of strings and some dates. Ultimately I want to construct something like a storage inventory. The records that form the input (and should be printed in the first database in rows) give you delivery date, sales date, etc. and a description of the goods. The second database should then give me the number of certain goods per period, that means I would have to run through the records and check if there has been a delivery containing the goods and how much has been sold (think of sales as a negative delivery) up to a certain point, so that I can calculate the inventory for that particular time period.