Date Field Value Validation

Win10 LO 7.1.2 HSQL 2.51

Hi,

How can one enforce that a date field entry of a new record is greater then the date in the previous record?

Thanks

Hello,

Once the data is entered (focus lost event) use a macro. Get the date from the control. Also use SQL to retrieve the previous record (only you knows what this is). Compare the two. Allow or reject.

You have received code for each of these items over the many previous answers.

@Ratslinger

Thanks, yes can do with a macro no problem, was just wondering if there was an alternative using something like table validation in HSQL

Think the only alternative may be a trigger.

The database couldn’t solve the problem to look for the previous record. The only possibility in HSQLDB is to check data in the same row before data will be saved. Example:

CREATE TABLE "Time" ("ID" INT PRIMARY KEY, "Begin" TIME, "End" TIME, 
CONSTRAINT "Begin<=End" CHECK ("Begin"<= "End"));

Thanks all

How is this a Solution? Better none than this!