Added query by period