Cast query period to int