On 4/14/16, Cecil Westerhof <cldwesterhof at gmail.com> wrote: > I have a table where I have two fields: toStart and finishBefore. They are > both dates and when filled the format should be %Y-%m-%d. How can this be > checked? 2016-04-31 should not be accepted. > > The second part is that when both are filled, then finishBefore should be > after toStart. Is that possible to check?
Untested: CHECK( toStart=date(toStart) AND finishBefore=date(finishBefore) AND finishBefore>toStart ) -- D. Richard Hipp drh at sqlite.org