Re: [SQL] diary constraints

2005-08-23 Thread A. Kretschmer
am 23.08.2005, um 9:33:58 +0100 mailte Gary Stainburn folgendes: > Hi folks > > I know this has been discussed in the past, but no amount of keywords > has returned anything from the archives. > > I want to create a courtesy car diary diary system where I have a table > containing all of the

Re: [SQL] diary constraints

2005-08-23 Thread PFC
a) the finish is after the start well, finish > start b) two allocations for a single vehicle don't overlap. this one is a bit tricky ! - Check that there is no allocation in the table whose time period start, end includes either the start of the end of the reservation to insert, and

Re: [SQL] diary constraints

2005-08-23 Thread Michael Glaesemann
On Aug 23, 2005, at 5:33 PM, Gary Stainburn wrote: I want to create a courtesy car diary diary system where I have a table containing all of the cortesy cars in the pool, and then an allocation table which has two timestamps, one for the start date/time and one for the return date/time. H

Re: [SQL] diary constraints

2005-08-23 Thread Gnanavel S
On 8/23/05, Gary Stainburn <[EMAIL PROTECTED]> wrote: Hi folksI know this has been discussed in the past, but no amount of keywordshas returned anything from the archives.I want to create a courtesy car diary diary system where I have a tablecontaining all of the cortesy cars in the pool, and then

Re: [SQL] diary constraints

2005-08-23 Thread neil.saunders
Hi Gary, I've actually just done the same thing - but for renting property. I've implemented the constraint as a trigger (Before insert/update, for each row), that first checks if the start_date is < end_date, and then performs a select on the bookings table using the OVERLAPS function. If the

[SQL] diary constraints

2005-08-23 Thread Gary Stainburn
Hi folks I know this has been discussed in the past, but no amount of keywords has returned anything from the archives. I want to create a courtesy car diary diary system where I have a table containing all of the cortesy cars in the pool, and then an allocation table which has two timestamps,