How far ahead can the tide be predicted?

As we know the position of the Moon and the Sun very accurately, we are able to compute the tides many years ahead (or into the past).