It took us quite a bit of effort and professional exterminators to get rid of the ants and this is the tip I learned from the exterminators. If ants are in your flower beds, then there are ways to discourage them as well as kill them. Control the aphids, without aphids, some ants will not have enough food. Ants do not like wet ground. Keep the garden well watered and your ant problems will decrease.
Ants love sugar.
Make tea - pennyroyal, spearmint, southernwood and tansy are all ant repellents when brewed and sprayed. Entomopathogenic nematodes can control ants, but you'd probably want to use a combination of Steinernema sp and Heterohabditis sp to accomplish this task. Click here for all the details.