楼上的是错的,正确的应该是 He asked if I had finished my task. (if 换成whether 也可以)
问题补充回答: He asked Andy where he had been.