JW Posted March 25, 2001 Posted March 25, 2001 A database with following fields : DateFrom (data) DateTo (date) Event (text, value-list) I need a workaround to prevent duplicate records that fall into a existing daterange (from
LiveOak Posted March 25, 2001 Posted March 25, 2001 Let's see if I can describe this. It's easier to do than explain. The concept is to use the start and end date fields and a script to fill a text field (call it EventDates) with a list of dates for the event. For example: DateFrom 3/1/2001 DateTo 3/5/2001 the field EventDates would be: 3/1/2001 3/2/2001 3/3/2001 3/4/2001 3/5/2001 Then create a self relationship (EventDate <--> Event Date). We'll call this relationship "SelfDates" This is a tricky way to create a many-to-many relationship. You can populate this field from DateFrom and DateTo using either a looping script or a plug-in. We'll call this relationship "SelfDates". Next create calculation fields: Constant (calculation, number) = 1 Error (calculation, text) = Case(Sum(SelfDates::Constant) > 1, "Duplicate Record!", "") This will give you a calculated field with an error message if dates overlap. To check for only events of the same type, you would need to build a more complex field than just a list of dates (date-event). -bd
JW Posted March 26, 2001 Author Posted March 26, 2001 Thanks for the quick reply. Still stuck : Field EventDates - repeated field ? - datefield ? Can't find syntax for looping script. Found allready workaround to check events of the same type. Are half-way. Thanks for help.
Recommended Posts
This topic is 8647 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now