Can i claim expenses for the whole year if I was a contractor for only 2 months. (i have a 1099 and a w2 from the same company)?

i only worked 2 months as a subcontractor then was hired on to the company. I was still required to use my own vehicle to get to and from work. can i still deduct the mileage and expenses for the whole year?