Jump to content

Prevent duplicate records


JW

This topic is 8453 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This topic is 8453 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.