We provide an answer to an open problem concerning the representation of preferences by intervals. Given a finite set of elements and three relations on this set (indifference, weak preference and strict preference), necessary and sufficient conditions are provided for representing the elements of the set by intervals in such a way that (1) two elements are indifferent when the interval associated to one of them is included in the interval associated to the other; (2) an element is weakly preferred to another when the interval of the first is "more to the right" than the interval of the other, but the two intervals have a non-empty intersection; (3) an element is strictly preferred to another when the interval of the first is "more to the r...