To clarify, much depends on the enclosure but its basically formal daywear with a few restrictions depending on where you are.
Grandstand is hats or fascinators, dresses must have straps, invisible ones don't count. Even if worn with a jacket, top or dress needs to comply, midrifts must be covered and although there is no formal restriction on dress length generally keep it decent and in line with formal daywear.
Royal Enclosure, shoulders covered ideally or broad straps i.e. inch plus, as above re jackets, dress must still comply and dress/ skirt should be knee length or longer, must wear a hat, fascinators are a no no. I think its relaxed a bit and length can be just above the knee now.
It all gets a bit easier in the ring and on the heath, smart is all it needs to be and that just adds to the fun of the day out!
So in a nutshell either dress would do the job if you are anywhere other than the Royal Enclosure in which case you might need to rethink on the first one! Enjoy the day!