Getting orders by period