RS=Parent.getDBHandler().MySQLSelect("SELECT InventoryID,InventoryIn,InventoryOut, unit, productname,prCode from Inventory,Product where TimeRecorded=Date_SUB(CurDate(),INTERVAL "+i+" Day)AND prCode=ProductCode;");
RT=Parent.getDBHandler().MySQLSelect("SELECT curDate();");
RT.first();
while(RS.next()){
Records.add(new InventoryRecord(RT.getString(1)+ctr, RS.getString(4), RS.getString(5), RT.getDate(1), RS.getInt(2)-RS.getInt(3), 0));
Parent.getDBHandler().MySQLinsert("Insert INTO INventory values ('"+(RT.getString(1)+ctr)
+"',"+(RS.getInt(2)-RS.getInt(3))+",0,now(),'"+RS.getString(6)+"');");
ctr++;
}