It's simpler than it seems at first.  If you're trying to find if there is a 
conflicting record, you're looking for something like this:

Existing_start_date < new_end_date and existing_end_date > new_start_date

That is, in order for the new time period to overlap the old one, the new time 
period has to end after the old one starts, and it has to begin before the old 
one ends.

Your query might look like this:

'Start Date' < $End Date$ AND 'End Date' > $Start Date$

Does that make sense?

Lyle

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Kemes, Lisa
Sent: Friday, April 03, 2009 12:12 PM
To: [email protected]
Subject: FW: Am I making this more difficult than it is?

**

I have a record with a Start Date field of: 4/12/2009 12:00:00 AM and an End 
Date field of: 4/30/2009 12:00:00 AM.

If someone were to create another record with a Start Date of: 4/1/2009 
12:00:00 AM and an End Date field of 4/15/2009 12:00:00 AM, I want it to error 
because this would "overwrite" (not really) the other record.

This is for my On Call system.  Therefore, if these 2 records are allowed to 
exist, you would have more than one person on call (as a primary) for the same 
dates (4/12, 4/13, 4/14 and 4/15).

Hope this makes sense!

I actually have these records on a table and I would like to walk through the 
table to make sure the records with the Start Date field: 4/1 and End Date 
field: 4/15 does not get created.

AR System 7.0
Oracle 10g
Windows 2003 Server


Lisa Kemes
AR System Developer
Tyco Electronics
717-810-2408 tel
717-810-2124 fax
[email protected]



__Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are" html___


 NOTICE: This email message is for the sole use of the intended recipient(s) 
and may contain confidential and privileged information. Any unauthorized 
review, use, disclosure or distribution is prohibited. If you are not the 
intended recipient, please contact the sender by reply email and destroy all 
copies of the original message.



_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
Platinum Sponsor: RMI Solutions ARSlist: "Where the Answers Are"

Reply via email to