A walk does not count as an at-bat. If I had three at-bats in a game and walked all three times, I would have finished the game 0-0 with 3 BB's. Since a Walk/Base on Balls does not count as an at-bat, the batting average is not affected.