I sort of found a solution to this problem by adding a payperiod date
field on top on the from - to date fields..But now
Field('hastafecha',
'date',default=midday,requires=IS_NOT_IN_DB(db,'db.timesheet.hastafecha'))is this validator accurate? it is not validating and I am getting double entries on the todate(hastafecha). On Feb 25, 6:43 pm, DenesL <[email protected]> wrote: > True, and so the plot thickens... > > On Feb 25, 8:20 pm, Anthony <[email protected]> wrote: > > > > > On Friday, February 25, 2011 4:25:00 PM UTC-5, DenesL wrote: > > > > The problem is checking against all dates already in the DB. > > > To avoid that I would have another table with the max(to_dates) and > > > min(from_dates) of all DB values, those will be updated with each new > > > insert if required. > > > > Why those values? to avoid any overlaps, then your new values must be > > > such that > > > to_date < min(from_dates) and from_date > max(to_dates) > > > Doesn't this just ensure that the new range is entirely before the earliest > > or after the latest existing range? What if you want to insert a range that > > fills a gap within the existing set of ranges -- wouldn't you have to > > compare against all the existing records in that case? > > > Anthony

