This paper deals with variational optimal-control problems on time scales in the presence of delay in the state variables. The problem is considered on a time scale unifying the discrete, the continuous, and the quantum cases. Two examples in the discrete and quantum cases are analyzed to illustrate our results.