It's going to depend upon which chemicals you mean. Caffeine has a half-life of about four hours (longer for some people). After a 24 hour period of abstinence, you'll still have 5% of your caffeine intake in your system. However, you're right - you can encourage it out with water. You'd want a bare minimum of a litre (18 ounces) and if you take a magnesium supplement and vitamin C, it'll help. Avoid all sugars. Caffeine plus sugar is not good. There's no formula for the amount of water. You just need to drink enough to encourage urination. Caffeine metabolites are eventually excreted as urine.
If you're thinking of the preservatives, four are used. Sulphur Dioxide (very harmful if breathed in but no problem in soft drinks, it'll get passed with your urine quicker than caffeine). Dimethyl Carbonate (I don't know enough about this one to answer). Potassium Sorbate (suspected of long-term health affects but is still the safest of the four preservatives and will be out of your system quickly). Sodium Benzoate (the last of the four and the most commonly used in my country. This one is processed by the liver as opposed to the kidneys and wouldn't be dangerous apart from how widespread it is. We're ingesting more of it than was ever imagined and there is research to suggest it poses a cancer risk).
If you're thinking of the sweeteners, this is a different story. Most products still use aspartame despite growing concerns about its toxicity and reported complications. Although aspartame itself may leave the body, the effect of it can last for well over a year. Most people (including me) don't have a short-term reaction if taken in moderation but I did once suffer aspartame-induced hallucinations from too high an intake. A can or two a day is safe for me (but not everyone).
To finally answer the question, there isn't a simple answer. But if I had to give one, I'd say 18 ounces of water to flush out most things within 36 hours (the 18 ounce figure is more down to how our bodies work as opposed to how much you have drank). To fully clear your body of all effects, though (in drinks with aspartame), it's not down to how much water you take in. Take in aspartame today won't leave you guaranteed clear until the summer of 2014.
This isn't mean to scare you, by the way. I still drink diet drinks myself. Although I tend to limit them. Also, it's difficult to avoid aspartame altogether. It's in toothpastes, mouthwash, chewing gum, sauces, condiments, desserts, jellies, jams, and all kinds of other things. In five years time, I think we'll all be using Stevia instead of aspartame (even though Stevia has been banned in both Europe and the U.S. and only recently approved for use).