building structure for employee office relation
What "datatype" is From_date?  Assuming it is DATE or DATETIME or TIMESTAMP, then this will find records before May, 2015:

select * from tbl_emp_office where From_date &lt; '2015-05-01';


This will find records for only May, 2015:

select * from tbl_emp_office 
    where From_date &gt;= '2015-05-01'
      and From_date  &lt; '2015-05-01' + INTERVAL 1 MONTH;


If you are using VARCHAR, well don't.

Edit to answer "Where was emp#1 working during May, 2015?"

SELECT  office_id
    FROM  tbl_emp_office
    WHERE  empid = 1
      AND  From_date &lt; '2015-05-01' + INTERVAL 1 MONTH -- Started before/during May
      AND  ( To_date IS NULL          -- Still working there
         OR  To_date &gt;= '2015-05-01'  -- Left during/after May
           );


Note:  If he worked in multiple offices during May, this will produce multiple rows.