try to read from database using from and to