if you reach base on an error is it an at bat
Error (baseball) An error does not count as a hit but still counts as an at bat for the batter unless, in the scorer's judgment, the batter would have reached first base safely but one or more of the additional base(s) reached was the result of the fielder's mistake. In that case, the play will be scored both as a hit (for the number of bases the fielders should have limited the batter to) and an error. However, if a batter is judged to have reached base solely because of a fielder's mistake, it is scored as a "hit on error," and treated the same as if the batter had been put out, hence lowering his batting average.
Extra innings Ordinarily, a baseball game consists of nine innings (in softball and high school baseball games there are typically seven innings; in Little League, six), each of which is divided into halves: the visiting team bats first, after which the home team takes its turn at bat. However, if the score remains tied at the end of the regulation number of complete innings, the rules provide that "play shall continue until (1) the visiting team has scored more total runs than the home team at the end of a completed inning; or (2) the home team scores the winning run in an uncompleted inning."