journals.physiology.org/doi...
'Despite the seemingly ubiquitous admonition to “drink at least eight 8-oz glasses of water a day” (with an accompanying reminder that beverages containing caffeine and alcohol do not count), rigorous proof for this counsel appears to be lacking.'
TL;DR: There's no published scientific evidence behind the "eight glasses a day" mantra. Coffee, tea and beer (in moderation) do count towards the total.
They concede that this is for people who do only mild exercise. For "vigorous work and exercise, especially in hot climates" extra fluids are needed.
It's an interesting read.